Add '--help'-flag to bash scripts
There was no easy way to get information of how to use the bash scripts
to build or publish the docker container images.
This change adds a '--help'-flag that prints a message of how to use
the scripts.
Change-Id: Iff8c1331c7458dc4586111a09855ff0f86e12261
diff --git a/build b/build
index 5b4827a..8dca157 100755
--- a/build
+++ b/build
@@ -2,12 +2,16 @@
usage() {
me=`basename "$0"`
- echo >&2 "Usage: $me [--tag TAG] [--gerrit-url URL] [IMAGE]"
+ echo >&2 "Usage: $me [--help] [--tag TAG] [--gerrit-url URL] [IMAGE]"
exit 1
}
while test $# -gt 0 ; do
case "$1" in
+ --help)
+ usage
+ ;;
+
--tag)
shift
TAG=$1
diff --git a/publish b/publish
index ca68922..b70e8c0 100755
--- a/publish
+++ b/publish
@@ -2,7 +2,7 @@
usage() {
me=`basename "$0"`
- echo >&2 "Usage: $me [--update-latest] [--registry REGISTRY] --tag TAG [IMAGE]"
+ echo >&2 "Usage: $me [--help] [--update-latest] [--registry REGISTRY] --tag TAG [IMAGE]"
exit 1
}
@@ -10,6 +10,9 @@
while test $# -gt 0 ; do
case "$1" in
+ --help)
+ usage
+ ;;
--update-latest)
UPDATE_LATEST=true
shift