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
46
47
48
49
#compdef run-stack rst
# eval "$(run-stack completion zsh)" # or: eval "$(rst completion zsh)"
_run_stack() {
local -a global workspace deploy shells bundler reload
global=(create new migrate upgrade update self-update completion help -h --help -v --version)
workspace=(
init up run down restart rebuild clean ps status ports commands apps list services logs shell sh
backend artisan composer migrate seed fresh pnpm dash dashboard
ios android device mobile reload prebuild desktop deploy sync-mobile-port bundler configure-bundler
)
deploy=(web mobile desktop)
shells=(bash zsh install services)
bundler=(ios android)
reload=(--clear)
if ((CURRENT == 2)); then
_describe -t commands 'run-stack command' global workspace
return
fi
case "${words[2]}" in
up|run|down|restart|rebuild|logs|shell|sh|status|ps)
_run_stack_services ;;
deploy)
_describe -t targets 'deploy target' deploy ;;
bundler|configure-bundler)
_describe -t platforms 'platform' bundler ;;
reload)
_describe -t options 'reload options' reload ;;
completion)
_describe -t shells 'shell' shells ;;
create|new|upgrade|update|migrate)
_files -/ ;;
esac
}
_run_stack_services() {
local -a services
services=("${(@f)$(run-stack completion services 2>/dev/null || rst completion services 2>/dev/null)}")
(( ${#services} )) || return 0
_describe -t services 'service' services
}
# #compdef only applies when this file is loaded from fpath. Eval install must
# register the completer explicitly (after compinit).
if (( $+functions[compdef] )); then
compdef _run_stack run-stack rst
fi