UNPKG

813 BPlain TextView Raw
1#compdef hophop
2
3local -a _commands
4_commands=(
5 'gh:GitHub workflow commands'
6)
7
8local -a _gh_commands
9_gh_commands=(
10 'feature:create a local branch referencing an open issue'
11 'pr:push the current feature branch and, if needed, open a pull request'
12 'commit:create a commit that closes an open issue'
13 'setup:setup GitHub API token'
14)
15
16local -a _gh_feature_commands
17_gh_feature_commands=(
18 'create:create a new issue for a feature'
19)
20
21_arguments '*:: :->command'
22
23if (( CURRENT == 1 )); then
24 _describe -t commands 'hophop command' _commands
25 return
26fi
27
28if (( CURRENT == 2 )); then
29 case "$words[1]" in
30 gh)
31 _describe 'gh command' _gh_commands ;;
32 esac
33fi
34
35if (( CURRENT == 3 )); then
36 case "$words[2]" in
37 feature)
38 _describe 'gh feature command' _gh_feature_commands ;;
39 esac
40fi