From 7411892782d5e1ec5e1297299c8bb4743f3580f2 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 2 Jan 2013 15:28:54 -0500 Subject: add --help flag --- testboot.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/testboot.sh b/testboot.sh index 120b813..fd65f58 100755 --- a/testboot.sh +++ b/testboot.sh @@ -18,14 +18,35 @@ compress=${compress:-$(type -P pigz || type -P xz)} [ "$compress" = "xz" ] && compress="xz --check-crc32 -1" +printhelp() { +cat << __EOT__ +Usage: $(basename $0) [OPTION...] [KERNEL ARGS...] +Boot a Fedora(ish) iso in a VM with the given kernel args. + + -h, --help show this help + -m, --ram=RAM create VM with this much ram (in MB) + -c, --virtconsole add a virtual console device (hvc0) + -s, --serialconsole add a serial console device (ttyS0) + -t, --text create VM with no graphics (console output on-screen) + -d, --fromcd boot from the CDROM device + --nocd don't attach the CDROM device + --dualnic create VM with two NICs + --nonic create VM with no NICs + +Edit testboot.conf to configure the paths and the ISO to use. +__EOT__ +} + + usecd="true" usenet="true" -ARGS=$(getopt --options "dcstm:" \ - --longoptions "fromcd,nocd,virtconsole,serialconsole,text,dualnic,nonic,ram:"\ +ARGS=$(getopt --options "hdcstm:" \ + --longoptions "help,fromcd,nocd,virtconsole,serialconsole,text,dualnic,nonic,ram:"\ --name testboot.sh \ -- "$@") || exit 1 eval set -- "$ARGS" while :; do case "$1" in + -h|--help) printhelp; exit 0;; -d|--fromcd) fromcd="true"; shift;; --nocd) usecd=""; shift;; --dualnic) dualnic="yes"; shift;; -- cgit