]> git.ozlabs.org Git - petitboot/commitdiff
util/pb-console: Packaging updates
authorGeoff Levand <geoff@infradead.org>
Sun, 19 May 2013 13:07:02 +0000 (21:07 +0800)
committerGeoff Levand <geoff@infradead.org>
Sun, 19 May 2013 13:07:02 +0000 (21:07 +0800)
In preparation for packaging add a man page, a help option, and some
comments to the script.

Signed-off-by: Geoff Levand <geoff@infradead.org>
man/Makefile.am
man/pb-console.8 [new file with mode: 0644]
utils/pb-console

index 4d4301bd4246ba96a9b5d7f7158ba819b07a7d3f..75a6bc347e6d69928baf958d3cdaaf0b925f9e2e 100644 (file)
@@ -12,6 +12,6 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
-dist_man_MANS = pb-discover.8 pb-event.8 petitboot-nc.8 petitboot-twin.8 pb-udhcpc.8 petitboot.8
+dist_man_MANS = pb-console.8 pb-discover.8 pb-event.8 petitboot-nc.8 petitboot-twin.8 pb-udhcpc.8 petitboot.8
 
 MAINTAINERCLEANFILES = Makefile.in
 
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/man/pb-console.8 b/man/pb-console.8
new file mode 100644 (file)
index 0000000..1430f22
--- /dev/null
@@ -0,0 +1,36 @@
+.\" Copyright Geoff Levand <geoff@infradead.org>
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; version 2 of the License.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for moZZre details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+.\"
+.Dd ""
+.Dt pb-console 8
+.Os
+.\"
+.Sh NAME
+.\" ====
+.Nm pb-console
+.Nd Petitboot console utility script
+.\"
+.Sh DESCRIPTION
+.\" ===========
+Petitboot utility script for running a petitboot UI program
+on a console tty.
+.\"
+.Sh SEE ALSO
+.\" ========
+.Xr petitboot 8
+.\"
+.Sh REPORTING BUGS
+.\" ==============
+Send bug reports to Geoff Levand <geoff @ infradead.org>
index 636c5ad36dff65d449d310309989d8c6967e6e65..c96ac9825d870e3039fb24d86706b50e4c988871 100644 (file)
@@ -1,16 +1,33 @@
 #!/bin/sh
 #!/bin/sh
+#
+# Petitboot utility script for running a petitboot UI program
+# on a console tty.
+#
 
 ui=petitboot-nc
 shell=sh
 
 detach=0
 
 
 ui=petitboot-nc
 shell=sh
 
 detach=0
 
+usage() {
+       echo "pb-console [OPTIONS] console_dev" >&2
+       echo "OPTIONS" >&2
+       echo "     -d, --detach" >&2
+       echo "             Start in a detached (background) state." >&2
+       echo "     -h, --help" >&2
+       echo "             Print a help message." >&2
+       exit 1
+}
+
 while [ -n "$1" ]
 do
        case "$1" in
 while [ -n "$1" ]
 do
        case "$1" in
-       -d)
+       --detach | -d)
                detach=1
                ;;
                detach=1
                ;;
+       --help | -h)
+               usage
+               ;;
        --)
                ;;
        *)
        --)
                ;;
        *)
@@ -29,7 +46,7 @@ pb_loop() {
        while :
        do
                $ui
        while :
        do
                $ui
-               echo "Exiting petitboot. Type 'exit' to return"
+               echo "Exiting petitboot. Type 'exit' to return."
                $shell
        done
 }
                $shell
        done
 }