-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands
executable file
·45 lines (40 loc) · 1.33 KB
/
commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
[[ " help $PLUGIN_COMMAND_PREFIX:help " == *" $1 "* ]] || [[ "$1" == "$PLUGIN_COMMAND_PREFIX:"* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_BASE_PATH/common/functions"
case "$1" in
$PLUGIN_COMMAND_PREFIX)
"$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/subcommands/default" "$@"
;;
help | $PLUGIN_COMMAND_PREFIX:help)
help_content_func() {
# shellcheck disable=SC2034
declare desc="return $PLUGIN_COMMAND_PREFIX plugin help content"
cat<<help_content
$PLUGIN_COMMAND_PREFIX, list apps and corresponding containers
help_content
}
if [[ $1 = "$PLUGIN_COMMAND_PREFIX:help" ]] ; then
echo -e "Usage: dokku $PLUGIN_COMMAND_PREFIX[:COMMAND] <app>"
echo ''
echo "List apps and corresponding containers."
echo ''
echo 'Example:'
echo ''
echo "\$ dokku $PLUGIN_COMMAND_PREFIX"
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
help_content_func
else
cat<<help_desc
$PLUGIN_COMMAND_PREFIX, Plugin for listing apps and containers
help_desc
fi
;;
*)
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;;
esac