]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-console
utils/pbconsole: Use here-document for usage text
[petitboot] / utils / pb-console
index 636c5ad36dff65d449d310309989d8c6967e6e65..00b25acf44c8d996bafaf178673805766a0f88b0 100644 (file)
@@ -1,16 +1,35 @@
 #!/bin/sh
+#
+# Petitboot utility script for running a petitboot UI program
+# on a console tty.
+#
 
 ui=petitboot-nc
 shell=sh
 
 detach=0
 
+usage() {
+       cat >&2 <<EOF
+pb-console [OPTIONS] console_dev
+OPTIONS
+     -d, --detach
+             Start in a detached (background) state.
+     -h, --help
+             Print a help message.
+EOF
+       exit 1
+}
+
 while [ -n "$1" ]
 do
        case "$1" in
-       -d)
+       --detach | -d)
                detach=1
                ;;
+       --help | -h)
+               usage
+               ;;
        --)
                ;;
        *)
@@ -29,7 +48,7 @@ pb_loop() {
        while :
        do
                $ui
-               echo "Exiting petitboot. Type 'exit' to return"
+               echo "Exiting petitboot. Type 'exit' to return."
                $shell
        done
 }