add -v option to clone_repo.sh

Do not show set -x output by default, but provide an option to enable
it.

Change-Id: Idba91c635ce179ce07945a6dc519e72e667b9463
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-11-13 11:11:51 -05:00
parent 1d70056104
commit 134df26a30
1 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,8 @@ Options:
-h -- Print help.
-v -- Verbose output (turn on set -x).
--workspace -- The name of the parent directory where the cloned
repo should be put.
@ -68,7 +70,7 @@ BRANCH="master"
REF=""
UPSTREAM="git://git.openstack.org"
OPTS=`getopt -o h --long branch:,cache-dir:,ref:,upstream:,workspace: -n $0 -- "$@"`
OPTS=`getopt -o hv --long branch:,cache-dir:,ref:,upstream:,workspace: -n $0 -- "$@"`
if [ $? != 0 ] ; then
echo "Failed parsing options." >&2
print_help
@ -81,6 +83,9 @@ while true; do
print_help
exit 0
;;
-v)
set -x
;;
--branch)
BRANCH="$2"
shift
@ -127,7 +132,6 @@ if [ ! -d "$WORKSPACE" ]; then
exit 1
fi
set -x
set -e
cache_remote="$CACHE_DIR/$REPO"