diff options
author | Victor Morales <victor.morales@intel.com> | 2017-08-15 16:24:05 -0500 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2017-08-15 16:26:12 -0500 |
commit | 5d5c5da9317e4681c10e6fe2a8f76aeb680d3517 (patch) | |
tree | 5ae5f3bf6b5773b19f469ecf01d7a39fff12315c /bootstrap/vagrant-onap/tools/run.sh | |
parent | e056249e9c28e76fbda59c8c4130ea96708bdc06 (diff) |
Add warnings and options to Run.ps1
This change add the same options and messages that was included
in 8a0c9450a19892d4254e2b69d04f3b84007b700b
Change-Id: I612dc3c3f679797c271ee3f452454e833c2b2aba
Issue-Id: INT-97
Signed-off-by: Victor Morales <victor.morales@intel.com>
Diffstat (limited to 'bootstrap/vagrant-onap/tools/run.sh')
-rwxr-xr-x | bootstrap/vagrant-onap/tools/run.sh | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/bootstrap/vagrant-onap/tools/run.sh b/bootstrap/vagrant-onap/tools/run.sh index aeb9d8c49..6ba4a1020 100755 --- a/bootstrap/vagrant-onap/tools/run.sh +++ b/bootstrap/vagrant-onap/tools/run.sh @@ -3,11 +3,11 @@ usage () { cat <<EOF -Usage: run.sh [-y] [-h] Command +Usage: run.sh [-y] [-?] Command Optional arguments: -y Skips warning prompt. - -h + -? Shows help about this program. -s <suite> Test suite to use in testing mode. @@ -26,32 +26,32 @@ test_case="*" COMMAND=${@: -1} -while getopts "yhs:c:" OPTION; do - case "$OPTION" in +while getopts "y?s:c:" OPTION; do + case "$OPTION" in y) - run=true - ;; + run=true + ;; s) - if [ "$COMMAND" != "testing" ] ; then - echo "Test suite should only be specified in testing mode." - echo "./run.sh -h for usage." - exit 0 - fi - test_suite=$OPTARG - ;; + if [ "$COMMAND" != "testing" ] ; then + echo "Test suite should only be specified in testing mode." + echo "./tools/run.sh -? for usage." + exit 1 + fi + test_suite=$OPTARG + ;; c) - if [ "$COMMAND" != "testing" ] ; then - echo "Test case should only be specified in testing mode." - echo "./run.sh -h for usage." + if [ "$COMMAND" != "testing" ] ; then + echo "Test case should only be specified in testing mode." + echo "./tools/run.sh -? for usage." + exit 1 + fi + test_case=$OPTARG + ;; + ?) + usage exit 0 - fi - test_case=$OPTARG - ;; - h) - usage - exit 0 - ;; - esac + ;; + esac done case $COMMAND in @@ -64,19 +64,19 @@ case $COMMAND in "testing" ) export DEPLOY_MODE='testing' if [ "$run" == false ] ; then - while true ; do - echo "Warning: This test script will delete the contents of ../opt/ and ~/.m2." - read -p "Would you like to continue? [y]es/[n]o: " yn - case $yn in - [Yy]*) - break - ;; - [Nn]*) - echo "Exiting." - exit 0 - ;; - esac - done + while true ; do + echo "Warning: This test script will delete the contents of ../opt/ and ~/.m2." + read -p "Would you like to continue? [y]es/[n]o: " yn + case $yn in + [Yy]*) + break + ;; + [Nn]*) + echo "Exiting." + exit 0 + ;; + esac + done fi export TEST_SUITE=$test_suite |