diff --git a/plugins/storage/commands b/plugins/storage/commands index 337f07473..03d73207f 100755 --- a/plugins/storage/commands +++ b/plugins/storage/commands @@ -1,26 +1,13 @@ #!/usr/bin/env bash [[ " storage:help help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" case "$1" in help | storage:help) - help_content_func () { - declare desc="return storage plugin help content" - cat<, List bind mounts for app's container(s) (host:container) - storage:mount , Create a new bind mount - storage:unmount , Remove an existing bind mount -help_content - } if [[ $1 = "shell:help" ]] ; then - echo -e 'Usage: dokku storage:COMMAND' - echo '' - echo 'Mount local volume / directories inside containers.' - echo '' - echo 'Additional commands:' - help_content_func | sort | column -c2 -t -s, + help_formatted else help_content_func fi diff --git a/plugins/storage/functions b/plugins/storage/functions index 767059f13..02752b0bc 100755 --- a/plugins/storage/functions +++ b/plugins/storage/functions @@ -2,6 +2,25 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +help_formatted (){ + echo -e 'Usage: dokku storage:COMMAND' + echo '' + echo 'Mount local volume / directories inside containers.' + echo '' + echo 'Additional commands:' + help_content_func | sort | column -c2 -t -s, +} + +help_content_func () { + declare desc="return storage plugin help content" + cat<, List bind mounts for app's container(s) (host:container) + storage:mount , Create a new bind mount + storage:unmount , Remove an existing bind mount +help_content + } + verify_paths() { declare desc="verifies storage paths" echo "$1" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon." diff --git a/plugins/storage/subcommands/default b/plugins/storage/subcommands/default new file mode 100644 index 000000000..764a9f5a0 --- /dev/null +++ b/plugins/storage/subcommands/default @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" + +storage_main_cmd() { + declare desc="Display storage plugin help content" + local cmd="storage" + help_formatted +} + +storage_main_cmd "$@"