diff options
-rw-r--r-- | Base/etc/SystemServer.ini | 8 | ||||
-rwxr-xr-x | Base/root/generate_manpages.sh | 52 | ||||
-rwxr-xr-x | Meta/lint-shell-scripts.sh | 5 |
3 files changed, 63 insertions, 2 deletions
diff --git a/Base/etc/SystemServer.ini b/Base/etc/SystemServer.ini index 68a5ed52c6..b09354fdb4 100644 --- a/Base/etc/SystemServer.ini +++ b/Base/etc/SystemServer.ini @@ -160,6 +160,14 @@ User=anon WorkingDirectory=/home/anon SystemModes=self-test +[GenerateManpages@ttyS0] +Executable=/root/generate_manpages.sh +StdIO=/dev/ttyS0 +Environment=DO_SHUTDOWN_AFTER_GENERATE=1 TERM=xterm PATH=/bin +User=root +WorkingDirectory=/root/ +SystemModes=generate-manpages + [SpiceAgent] KeepAlive=0 diff --git a/Base/root/generate_manpages.sh b/Base/root/generate_manpages.sh new file mode 100755 index 0000000000..94180915f3 --- /dev/null +++ b/Base/root/generate_manpages.sh @@ -0,0 +1,52 @@ +#!/bin/Shell + +export ARGSPARSER_EMIT_MARKDOWN=1 + +# Qemu likes to start us in the middle of a line, so: +echo + +rm -rf generated_manpages || exit 1 + +for i in ( \ + (Eyes 1) \ + (UserspaceEmulator 1) \ + (TelnetServer 1) \ + (WebServer 1) \ + (config 1) \ + (fortune 1) \ + (grep 1) \ + (gunzip 1) \ + (gzip 1) \ + (ifconfig 1) \ + (lsof 1) \ + (nc 1) \ + (netstat 1) \ + (nl 1) \ + (ntpquery 1) \ + (passwd 1) \ + (profile 1) \ + (readelf 1) \ + (shot 1) \ + (sql 1) \ + (strace 1) \ + (tail 1) \ + (tr 1) \ + (traceroute 1) \ + (tree 1) \ + (truncate 1) \ + (usermod 8) \ + (utmpupdate 1) \ + (wc 1) \ + ) { + filename="generated_manpages/man$i[1]/$i[0].md" + mkdir -p "generated_manpages/man$i[1]" + echo "Generating for $i[0] in $filename ..." + $i[0] --help > "$filename" || exit 1 + echo -e "\n<!-- Auto-generated through ArgsParser -->" >> "$filename" || exit 1 +} + +echo "Successful." + +if test $DO_SHUTDOWN_AFTER_GENERATE { + shutdown -n +} diff --git a/Meta/lint-shell-scripts.sh b/Meta/lint-shell-scripts.sh index 0966b3fc64..dfa00cec7e 100755 --- a/Meta/lint-shell-scripts.sh +++ b/Meta/lint-shell-scripts.sh @@ -11,12 +11,13 @@ if [ "$#" -eq "0" ]; then '*.sh' \ ':!:Ports' \ ':!:Userland/Shell/Tests' \ - ':!:Base/home/anon/tests' + ':!:Base/home/anon/tests' \ + ':!:Base/root/generate_manpages.sh' ) else files=() for file in "$@"; do - if [[ "${file}" == *".sh" ]]; then + if [[ "${file}" == *".sh" && "${file}" != "Base/root/generate_manpages.sh" ]]; then files+=("${file}") fi done |