diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-12-25 14:34:16 +0100 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-12-27 11:31:03 +0000 |
commit | ee26765bdff77a4aa23efd0a8936d4306ec61c4b (patch) | |
tree | c8924f7d2f06739fc4bdda3936b87f3a9854c959 /run-tests-in-vagrant.sh | |
parent | 73823181dd0ffa51761c30eefbc2f43888ffe044 (diff) |
tests/vagrant: add a --help option to the script
Change-Id: I89913375fedb6a7617873b09039de72bf1773c68
BUG: 1526780
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'run-tests-in-vagrant.sh')
-rwxr-xr-x | run-tests-in-vagrant.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/run-tests-in-vagrant.sh b/run-tests-in-vagrant.sh index 4b12fed7d54..f7838f4732a 100755 --- a/run-tests-in-vagrant.sh +++ b/run-tests-in-vagrant.sh @@ -23,10 +23,25 @@ popd () { command popd "$@" >/dev/null } +usage() { + echo "Usage: $0 [...]" + echo '' + echo 'The options that this script accepts are:' + echo '' + echo '-a, --autostart configure the testVM to autostart on boot' + echo '--destroy-now cleanup the testVM' + echo '--destroy-after-test cleanup once the tests finishes' + echo '-h, --help show this help text' + echo '--os=<flavor> select the OS for the testVM (fedora, centos6)' + echo '--ssh ssh into the testVM' + echo '--verbose show what commands in the testVM are executed' + echo '' +} + function parse_args () { args=`getopt \ - --options a \ - --long autostart,os:,destroy-now,destroy-after-test,verbose,ssh \ + --options ah \ + --long autostart,os:,destroy-now,destroy-after-test,verbose,ssh,help \ -n 'run-tests-in-vagrant.sh' \ -- "$@"` eval set -- "$args" @@ -35,6 +50,7 @@ function parse_args () { -a|--autostart) autostart="yes"; shift ;; --destroy-after-test) destroy_after_test="yes"; shift ;; --destroy-now) destroy_now="yes"; shift ;; + -h|--help) usage ; exit 0 ;; --ssh) sshvm="yes"; shift ;; --os) case "$2" in |