diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands index f7911fc25..2995231d7 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -1,26 +1,14 @@ #!/usr/bin/env bash [[ " help nginx:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" case "$1" in help | nginx:help) - help_content_func () { - declare desc="return nginx plugin help content" - cat<, (Re)builds nginx config for given app - nginx:access-logs [-t], Show the nginx access logs for an application (-t follows) - nginx:error-logs [-t], Show the nginx error logs for an application (-t follows) -help_content - } + if [[ $1 = "nginx:help" ]] ; then - echo -e 'Usage: dokku nginx[:COMMAND]' - echo '' - echo 'Interact with Dokku'"'"'s Nginx proxy.' - echo '' - echo 'Additional commands:' - help_content_func | sort | column -c2 -t -s, + help_formatted else help_content_func fi diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 2b6f6bc4b..e98e2e704 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -6,6 +6,25 @@ source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/domains/functions" source "$PLUGIN_AVAILABLE_PATH/ps/functions" +help_formatted (){ + echo -e 'Usage: dokku nginx[:COMMAND]' + echo '' + echo 'Interact with Dokku'"'"'s Nginx proxy.' + echo '' + echo 'Additional commands:' + help_content_func | sort | column -c2 -t -s, +} + +help_content_func () { + declare desc="return nginx plugin help content" + cat<, (Re)builds nginx config for given app + nginx:access-logs [-t], Show the nginx access logs for an application (-t follows) + nginx:error-logs [-t], Show the nginx error logs for an application (-t follows) +help_content + } + validate_nginx() { declare desc="validate entire nginx config" set +e diff --git a/plugins/nginx-vhosts/subcommands/default b/plugins/nginx-vhosts/subcommands/default new file mode 100644 index 000000000..30cb86061 --- /dev/null +++ b/plugins/nginx-vhosts/subcommands/default @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/config/functions" +source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions" + +nginx_main_cmd() { + declare desc="display nginx plugin help content" + local cmd="nginx" + help_formatted +} + +nginx_main_cmd "$@"