diff --git a/modules/services.sh b/modules/services.sh index 63a1988d82..9295a74703 100644 --- a/modules/services.sh +++ b/modules/services.sh @@ -22,9 +22,7 @@ function services { # list all installed services elif [ "$service_name" = "installed" ]; then checkargn $# 2 - if [ "$command" = "full" ]; then - docker ps -a - elif [ -z "$command" ]; then + if [ -z "$command" ]; then available=($(services available)) for service in "${available[@]}" do @@ -32,13 +30,17 @@ function services { echo $service fi done + elif [ "$command" = "full" ]; then + docker ps -a + else + echo "ERROR: unknown command option" + echo "USAGE: $BASENAME services installed " + exit 1 fi # list all running services elif [ "$service_name" = "running" ]; then checkargn $# 2 - if [ "$command" = "full" ]; then - docker ps - elif [ -z "$command" ]; then + if [ -z "$command" ]; then running=$(docker ps --format '{{.Names}}') array=($running) results="" @@ -54,6 +56,12 @@ function services { results+=" " done echo ${results} | tr ' ' '\n' | uniq | xargs + elif [ "$command" = "full" ]; then + docker ps + else + echo "ERROR: unknown command option" + echo "USAGE: $BASENAME services running " + exit 1 fi # list all ports used by services elif [ "$service_name" = "ports" ]; then diff --git a/package.json b/package.json index d12a3cd379..0ae79f9dfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.16.21", + "version": "1.16.22", "remote": "2251", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh",