From ee26765bdff77a4aa23efd0a8936d4306ec61c4b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 25 Dec 2017 14:34:16 +0100 Subject: tests/vagrant: add a --help option to the script Change-Id: I89913375fedb6a7617873b09039de72bf1773c68 BUG: 1526780 Signed-off-by: Niels de Vos --- run-tests-in-vagrant.sh | 20 ++++++++++++++++++-- 1 file 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= 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 -- cgit