From 010792f7141335ec81fa3fb2c5c58d311dd42c1b Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 7 Aug 2015 11:44:47 +0100 Subject: [PATCH] cosmetic: more sensible order of weave commands --- weave | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/weave b/weave index d7408688..73254d8c 100755 --- a/weave +++ b/weave @@ -30,6 +30,7 @@ usage() { Usage: weave setup +weave version weave launch [--password ] [--nickname ] [--ipalloc-range [--ipalloc-default-subnet ]] [--no-discovery] [--init-peer-count ] ... @@ -40,8 +41,11 @@ weave launch-proxy [-H ] [--with-dns | --without-dns] [--no-default-ipalloc] [--no-rewrite-hosts] [--hostname-match ] [--hostname-replacement ] +weave env +weave config weave connect [--replace] [ ...] weave forget ... +weave status weave run [--with-dns | --without-dns] [ ...] ... weave start [ ...] @@ -53,10 +57,6 @@ weave dns-lookup weave expose [ ...] [-h ] weave hide [ ...] weave ps [ ...] -weave status -weave env -weave config -weave version weave stop weave stop-router weave stop-proxy @@ -1256,6 +1256,21 @@ case "$COMMAND" in docker pull $img done ;; + version) + [ $# -eq 0 ] || usage + echo weave script $SCRIPT_VERSION + ask_version $CONTAINER_NAME $IMAGE || true + if ! EXEC_IMAGE_ID=$(docker inspect --format='{{.Id}}' $EXEC_IMAGE 2>/dev/null) ; then + echo "Unable to find $EXEC_IMAGE image." >&2 + else + EXEC_VERSION=$(docker images --no-trunc | grep $EXEC_IMAGE_ID | grep -v latest | tr -s ' ' | cut -d ' ' -f 2 | tr "\n" ' ') + if [ -n "$EXEC_VERSION" ] ; then + echo "weave exec $EXEC_VERSION" + else + echo "weave exec (unreleased version)" + fi + fi + ;; # intentionally undocumented since it assumes knowledge of weave # internals create-bridge) @@ -1311,25 +1326,6 @@ case "$COMMAND" in fi [ $res -eq 0 ] ;; - ps) - [ $# -eq 0 ] && CONTAINERS="weave:expose $(docker ps -q)" || CONTAINERS="$@" - with_container_addresses echo_addresses $CONTAINERS - ;; - version) - [ $# -eq 0 ] || usage - echo weave script $SCRIPT_VERSION - ask_version $CONTAINER_NAME $IMAGE || true - if ! EXEC_IMAGE_ID=$(docker inspect --format='{{.Id}}' $EXEC_IMAGE 2>/dev/null) ; then - echo "Unable to find $EXEC_IMAGE image." >&2 - else - EXEC_VERSION=$(docker images --no-trunc | grep $EXEC_IMAGE_ID | grep -v latest | tr -s ' ' | cut -d ' ' -f 2 | tr "\n" ' ') - if [ -n "$EXEC_VERSION" ] ; then - echo "weave exec $EXEC_VERSION" - else - echo "weave exec (unreleased version)" - fi - fi - ;; run) dns_args "$@" shift $(dns_arg_count "$@") @@ -1461,6 +1457,10 @@ case "$COMMAND" in done show_addrs $ALL_CIDRS ;; + ps) + [ $# -eq 0 ] && CONTAINERS="weave:expose $(docker ps -q)" || CONTAINERS="$@" + with_container_addresses echo_addresses $CONTAINERS + ;; stop) [ $# -eq 0 ] || usage stop $PROXY_CONTAINER_NAME "Proxy"