diff options
author | Will Woods <wwoods@redhat.com> | 2013-01-02 15:28:54 -0500 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2013-01-02 15:28:54 -0500 |
commit | 7411892782d5e1ec5e1297299c8bb4743f3580f2 (patch) | |
tree | a0c6f770692c54ed87e6eac03d7299855921446d | |
parent | 23bffb6f9ba940a60e34bf11b37d37f0508a252a (diff) | |
download | testboot-7411892782d5e1ec5e1297299c8bb4743f3580f2.tar.gz testboot-7411892782d5e1ec5e1297299c8bb4743f3580f2.tar.xz testboot-7411892782d5e1ec5e1297299c8bb4743f3580f2.zip |
add --help flag
-rwxr-xr-x | testboot.sh | 25 |
1 files 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;; |