From fbf76127263970f9dab8f7dd6c848fe3cb07a1cc Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 19 Apr 2015 10:32:13 +0100 Subject: [PATCH] only check for command / print usage at remote This is desirable since we want to do as little as possible locally, and not duplicate any checks. --- weave | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/weave b/weave index 92388f2a..1926d86a 100755 --- a/weave +++ b/weave @@ -64,8 +64,6 @@ exec_remote() { $EXEC_IMAGE --local "$@" } -[ $# -gt 0 ] || usage - # "run" is a special case because we want to use docker directly, # rather than the docker in $EXEC_IMAGE remotely. That's because we # are passing arbitrary arguments on to docker run, and we can't rely @@ -87,10 +85,6 @@ PORT=${WEAVE_PORT:-6783} HTTP_PORT=6784 DNS_HTTP_PORT=6785 -COMMAND=$1 - -shift 1 - ###################################################################### # general helpers; independent of docker and weave ###################################################################### @@ -608,6 +602,10 @@ DOCKER_VERSION_MAJOR=$(echo "$DOCKER_VERSION" | cut -d. -f 1) DOCKER_VERSION_MINOR=$(echo "$DOCKER_VERSION" | cut -d. -f 2) DOCKER_VERSION_PATCH=$(echo "$DOCKER_VERSION" | cut -d. -f 3) +[ $# -gt 0 ] || usage +COMMAND=$1 +shift 1 + case "$COMMAND" in setup) for img in $IMAGE $DNS_IMAGE $EXEC_IMAGE ; do