refactor: move domains:help to internal-functions
This commit is contained in:
@@ -1,35 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
[[ " help domains:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
[[ " help domains:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/domains/internal-functions"
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
help | domains:help)
|
help | domains:help)
|
||||||
help_content_func () {
|
domains_help_cmd "$@"
|
||||||
declare desc="return domains plugin help content"
|
|
||||||
cat<<help_content
|
|
||||||
domains [<app>], List domains
|
|
||||||
domains:add <app> <domain> [<domain> ...], Add domains to app
|
|
||||||
domains:add-global <domain> [<domain> ...], Add global domain names
|
|
||||||
domains:clear <app>, Clear all domains for app
|
|
||||||
domains:disable <app>, Disable VHOST support
|
|
||||||
domains:enable <app>, Enable VHOST support
|
|
||||||
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
|
||||||
domains:remove-global <domain> [<domain> ...], Remove global domain names
|
|
||||||
domains:set <app> <domain> [<domain> ...], Set domains for app
|
|
||||||
domains:set-global <domain> [<domain> ...], 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
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
35
plugins/domains/internal-functions
Executable file
35
plugins/domains/internal-functions
Executable file
@@ -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<<help_content
|
||||||
|
domains [<app>], List domains
|
||||||
|
domains:add <app> <domain> [<domain> ...], Add domains to app
|
||||||
|
domains:add-global <domain> [<domain> ...], Add global domain names
|
||||||
|
domains:clear <app>, Clear all domains for app
|
||||||
|
domains:disable <app>, Disable VHOST support
|
||||||
|
domains:enable <app>, Enable VHOST support
|
||||||
|
domains:remove <app> <domain> [<domain> ...], Remove domains from app
|
||||||
|
domains:remove-global <domain> [<domain> ...], Remove global domain names
|
||||||
|
domains:set <app> <domain> [<domain> ...], Set domains for app
|
||||||
|
domains:set-global <domain> [<domain> ...], 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<<help_desc
|
||||||
|
domains, Manage vhost domains used by the Dokku proxy
|
||||||
|
help_desc
|
||||||
|
fi
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user