diff --git a/plugins/domains/commands b/plugins/domains/commands index 5b2018369..1ed2fde7f 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -1,35 +1,11 @@ #!/usr/bin/env bash [[ " help domains:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" +source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions" set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in help | domains:help) - help_content_func () { - declare desc="return domains plugin help content" - cat<], List domains - 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 domains from app - domains:remove-global [ ...], Remove global domain names - domains:set [ ...], Set domains for app - domains:set-global [ ...], Set global domain names -help_content - } - - if [[ $1 = "domains:help" ]] ; then - echo -e 'Usage: dokku domains[:COMMAND]' - echo '' - echo 'Manage vhost domains used by the Dokku proxy.' - echo '' - echo 'Additional commands:' - help_content_func | sort | column -c2 -t -s, - else - help_content_func - fi + domains_help_cmd "$@" ;; *) diff --git a/plugins/domains/internal-functions b/plugins/domains/internal-functions new file mode 100755 index 000000000..33ab2dd1c --- /dev/null +++ b/plugins/domains/internal-functions @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +domains_help_content_func () { + declare desc="return domains plugin help content" + cat<], List domains + 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 domains from app + domains:remove-global [ ...], Remove global domain names + domains:set [ ...], Set domains for app + domains:set-global [ ...], Set global domain names +help_content +} + +domains_help_cmd() { + if [[ $1 = "domains:help" ]] ; then + echo -e 'Usage: dokku domains[:COMMAND]' + echo '' + echo 'Manage vhost domains used by the Dokku proxy.' + echo '' + echo 'Additional commands:' + domains_help_content_func | sort | column -c2 -t -s, + elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then + domains_help_content_func + else + cat<