diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-18 15:18:29 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-24 11:48:17 +0000 |
commit | 1b179184461b3fa10f4710a58bcdeeb703ee6c86 (patch) | |
tree | fd263b12055423156cf698b878544f5df71d418b /start-container-docker.sh | |
parent | 0057fd53d72afac43efb6990263148aaba2c75ec (diff) |
start-docker-container.sh: Add --verbose true/false option.
Change-Id: Iaf7818cf3d73c69a3256b848c359daca27853eba
Diffstat (limited to 'start-container-docker.sh')
-rwxr-xr-x | start-container-docker.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/start-container-docker.sh b/start-container-docker.sh index e17279b5..bb750ec0 100755 --- a/start-container-docker.sh +++ b/start-container-docker.sh @@ -15,7 +15,7 @@ set -e # - definition of ${session_host} and ${session_port}, can be used for # a remote connexion to the container usage() { - echo "Usage: $0 [--arch container-arch] --distro flavour [--docker_opts opts] [--dryrun true/false] [--label label] [--newuser username:[uid]] [--node node] [--prefix prefix] [--session-host host] [--session-name name] [--task {build|test}] [--user user] [--weight weight]" + echo "Usage: $0 [--arch container-arch] --distro flavour [--docker_opts opts] [--dryrun true/false] [--label label] [--newuser username:[uid]] [--node node] [--prefix prefix] [--session-host host] [--session-name name] [--task {build|test}] [--user user] [--weight weight] [--verbose true/false]" echo echo " container-arch: architecture (eg: amd64, i386, arm64, armhf)" echo " distro: distribution (eg: trusty)" @@ -30,6 +30,7 @@ usage() { echo " task: type of container (build or test, default=build)" echo " user: remote user to use in the container." echo " weight: container weight, reserves resources. Default=1" + echo " verbose: whether enable verbose output. Default=false" exit 1 } @@ -52,6 +53,7 @@ session_name= task="build" weight=1 user= +verbose="false" while [ $# -ge 1 ] do @@ -122,6 +124,11 @@ do [ x${weight} = x ] && usage shift 2 ;; + --verbose) + verbose=$2 + [ x${verbose} = x ] && usage + shift 2 + ;; *) echo "Unsupported option: $1" usage @@ -129,6 +136,8 @@ do esac done +if $verbose; then set -x; fi + dryruncmd="" if $dryrun; then dryruncmd="echo" |