From f2da35e8132bc39d600ebb30f1b21cf8d4dba7ac Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Sun, 11 Aug 2019 00:20:37 -0400 Subject: [PATCH] Rename 'system' action to 'system:info' --- psu | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/psu b/psu index b11a3c6..cc32ca0 100644 --- a/psu +++ b/psu @@ -60,7 +60,7 @@ main() { "list;Lists of the stacks already deployed;url|user|password;endpoint|quiet|insecure|verbose|debug|masked-variables|help" "info;Stack information;url|user|password|name;endpoint|quiet|insecure|verbose|debug|masked-variables" "status;Check if the stack is running/deployed correctly;url|user|password|name;endpoint|service|detect-job|timeout|insecure|verbose|debug|masked-variables" - "system;Display Docker system-wide information;url|user|password;endpoint|insecure|verbose|debug|masked-variables" + "system:info;Display Docker system-wide information;url|user|password;endpoint|insecure|verbose|debug|masked-variables" "services;Lists services already deployed for the current stack;url|user|password|name;endpoint|quiet|insecure|verbose|debug|masked-variables" "tasks;Lists tasks for the current stack;url|user|password|name;endpoint|service|detect-job|timeout|quiet|insecure|verbose|debug|masked-variables" "tasks:healthy;Lists tasks who are running correctly for the current stack;url|user|password|name;endpoint|service|detect-job|timeout|quiet|insecure|verbose|debug|masked-variables" @@ -85,8 +85,8 @@ main() { ["stacks:list"]="list" ["stacks:info"]="info" ["stacks:status"]="status" - ["system:info"]="system" - ["docker:info"]="system" + ["system"]="system:info" + ["docker:info"]="system:info" ["services:list"]="services" ["tasks:list"]="tasks" ["containers:list"]="containers" @@ -187,11 +187,12 @@ main() { fi # Returns Docker system info - if [ $ACTION == "system" ]; then + if [ $ACTION == "system:info" ]; then local docker_info echo_verbose "Getting Docker info..." docker_info="$(docker_info)" echo_debug "Docker info -> $(echo $docker_info | jq -C .)" + if [ -n "$docker_info" ]; then echo "$docker_info" exit 0 @@ -424,7 +425,7 @@ set_globals() { exit 1 fi fi - if [ "$ACTION" != "list" ] && [ "$ACTION" != "system" ] && [[ ! ${ACTIONS_TEXT_ONLY[*]} =~ $ACTION ]]; then + if [ "$ACTION" != "list" ] && [ "$ACTION" != "system:info" ] && [[ ! ${ACTIONS_TEXT_ONLY[*]} =~ $ACTION ]]; then check_argument "$PORTAINER_STACK_NAME" "portainer stack name" "PORTAINER_STACK_NAME" "n" "name" fi }