From 9265bd8e371148d34ed651d3b06a17dd93b86575 Mon Sep 17 00:00:00 2001 From: Ilya Semenov Date: Thu, 8 Sep 2016 13:21:30 +0700 Subject: [PATCH] Unified help texts and descriptions for domains add and remove commands --- docs/configuration/domains.md | 16 ++++++++-------- plugins/domains/commands | 8 ++++---- plugins/domains/subcommands/add | 8 ++------ plugins/domains/subcommands/add-global | 4 ++-- plugins/domains/subcommands/remove | 7 +------ plugins/domains/subcommands/remove-global | 4 ++-- 6 files changed, 19 insertions(+), 28 deletions(-) diff --git a/docs/configuration/domains.md b/docs/configuration/domains.md index 185341e64..fdda6a71f 100644 --- a/docs/configuration/domains.md +++ b/docs/configuration/domains.md @@ -3,14 +3,14 @@ > New as of 0.3.10 ``` -domains:add DOMAIN # Add a domain to app -domains:add-global # Add global domain name -domains [] # List domains -domains:clear # Clear all domains for app -domains:disable # Disable VHOST support -domains:enable # Enable VHOST support -domains:remove DOMAIN # Remove a domain from app -domains:remove-global # Remove global domain name +domains:add [ ...] # Add domains to app +domains:add-global [ ...] # Add global domain names +domains [] # List domains +domains:clear # Clear all domains for app +domains:disable # Disable VHOST support +domains:enable # Enable VHOST support +domains:remove [ ...] # Remove domains from app +domains:remove-global [ ...] # Remove global domain names ``` > Adding a domain before deploying an application will result in port mappings being set. This may cause issues for applications that use non-standard ports, as those will not be automatically detected. Please refer to the [proxy documentation](/dokku/advanced-usage/proxy-management/) for information as to how to reconfigure the mappings. diff --git a/plugins/domains/commands b/plugins/domains/commands index f59e9fc60..7504678f7 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -8,13 +8,13 @@ case "$1" in declare desc="return domains plugin help content" cat<], List domains - domains:add [...], Add domain(s) to app - domains:add-global [...], Add global domain name(s) + domains:add [ ...], Add domains to app + domains:add-global [ ...], Add global domain names domains:clear , Clear all domains for app domains:disable , Disable VHOST support domains:enable , Enable VHOST support - domains:remove [...], Remove domain(s) from app - domains:remove-global [...], Remove global domain name(s) + domains:remove [ ...], Remove domains from app + domains:remove-global [ ...], Remove global domain names help_content } diff --git a/plugins/domains/subcommands/add b/plugins/domains/subcommands/add index b58d45a20..168618eab 100755 --- a/plugins/domains/subcommands/add +++ b/plugins/domains/subcommands/add @@ -4,15 +4,11 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_add_cmd() { - declare desc="adds domain to app via command line" + declare desc="adds domains to app via command line" local cmd="domains:add" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" + [[ -z $3 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 [ ...]" - if [[ -z "${*:3}" ]]; then - echo "Usage: dokku $1 $2 DOMAIN [DOMAIN ...]" - echo "Must specify DOMAIN." - exit 1 - fi shift 1 domains_add "$@" } diff --git a/plugins/domains/subcommands/add-global b/plugins/domains/subcommands/add-global index d71b27615..5283576b4 100755 --- a/plugins/domains/subcommands/add-global +++ b/plugins/domains/subcommands/add-global @@ -4,9 +4,9 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_add_global_cmd() { - declare desc="add global domain name via command line" + declare desc="add global domain names via command line" local cmd="domains:add-global" - [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 DOMAIN [DOMAIN ...]" + [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 [ ...]" shift 1 domains_add_global "$@" diff --git a/plugins/domains/subcommands/remove b/plugins/domains/subcommands/remove index 1d0e44695..6d508a0e4 100755 --- a/plugins/domains/subcommands/remove +++ b/plugins/domains/subcommands/remove @@ -7,12 +7,7 @@ domains_remove_cmd() { declare desc="removes domains from app via command line" local cmd="domains:remove" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" - - if [[ -z "${*:3}" ]]; then - echo "Usage: dokku $1 $2 DOMAIN [DOMAIN ...]" - echo "Must specify DOMAIN." - exit 1 - fi + [[ -z $3 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 $2 [ ...]" shift 1 domains_remove "$@" diff --git a/plugins/domains/subcommands/remove-global b/plugins/domains/subcommands/remove-global index 5a7c0ee80..86f4caff5 100755 --- a/plugins/domains/subcommands/remove-global +++ b/plugins/domains/subcommands/remove-global @@ -4,9 +4,9 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" domains_remove_global_cmd() { - declare desc="remove global domain name via command line" + declare desc="remove global domain names via command line" local cmd="domains:remove-global" - [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 DOMAIN [DOMAIN ...]" + [[ -z $2 ]] && dokku_log_fail "Please specify a domain name. Usage: dokku $1 [ ...]" shift 1 domains_remove_global "$@"