Print usage on --help argument to any command
This commit is contained in:
1 parent
cf87a84bd9
commit
5db7a2bae1
1 file changed
+15
-6
@@ -108,6 +108,13 @@ usage() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_help_arg() {
|
||||||
|
if [ "$1" = "--help" ] ; then
|
||||||
|
usage_no_exit
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
docker_sock_options() {
|
docker_sock_options() {
|
||||||
# Pass through DOCKER_HOST if it is a Unix socket;
|
# Pass through DOCKER_HOST if it is a Unix socket;
|
||||||
# a TCP socket may be secured by TLS, in which case we can't use it
|
# a TCP socket may be secured by TLS, in which case we can't use it
|
||||||
@@ -325,12 +332,11 @@ check_docker_version
|
|||||||
|
|
||||||
[ "$1" = "--local" ] && shift 1 && IS_LOCAL=1
|
[ "$1" = "--local" ] && shift 1 && IS_LOCAL=1
|
||||||
|
|
||||||
if [ "$1" = "--help" -o "$1" = "help" ] ; then
|
# "--help|help" are special because we always want to process them
|
||||||
# "--help|help" are special because we always want to process them
|
# at the client end.
|
||||||
# at the client end.
|
handle_help_arg "$1" || handle_help_arg "--$1"
|
||||||
usage_no_exit
|
|
||||||
exit 0
|
if [ "$1" = "version" -a -z "$IS_LOCAL" ] ; then
|
||||||
elif [ "$1" = "version" -a -z "$IS_LOCAL" ] ; then
|
|
||||||
# non-local "version" is special because we want to show the
|
# non-local "version" is special because we want to show the
|
||||||
# version of the script executed by the user rather than what is
|
# version of the script executed by the user rather than what is
|
||||||
# embedded in weaveexec.
|
# embedded in weaveexec.
|
||||||
@@ -352,6 +358,7 @@ elif [ "$1" = "run" -a -z "$IS_LOCAL" ] ; then
|
|||||||
# we can't rely on our baked-in docker to support those arguments.
|
# we can't rely on our baked-in docker to support those arguments.
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
|
handle_help_arg "$1"
|
||||||
[ "$1" = "--without-dns" ] || DNS_ARGS=$(exec_remote dns-args "$@" || true)
|
[ "$1" = "--without-dns" ] || DNS_ARGS=$(exec_remote dns-args "$@" || true)
|
||||||
shift $(dns_arg_count "$@")
|
shift $(dns_arg_count "$@")
|
||||||
|
|
||||||
@@ -1863,6 +1870,8 @@ deprecation_warnings() {
|
|||||||
COMMAND=$1
|
COMMAND=$1
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
|
handle_help_arg "$1"
|
||||||
|
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
setup)
|
setup)
|
||||||
for img in $IMAGE $EXEC_IMAGE $PLUGIN_IMAGE $WEAVEDB_IMAGE ; do
|
for img in $IMAGE $EXEC_IMAGE $PLUGIN_IMAGE $WEAVEDB_IMAGE ; do
|
||||||
|
|||||||
Reference in new issue
Block a user