UNPKG

1.2 kBPlain TextView Raw
1#compdef hophop
2
3local -a _commands
4_commands=(
5 'gh:GitHub workflow commands'
6 'toggl:Toggl time tracker commands'
7)
8
9local -a _toggl_commands
10_toggl_commands=(
11 'start:start time tracking for the current issue'
12 'misc:start time tracking for generic task'
13 'test:start time tracking for test task'
14 'stop:stop time tracking'
15 'setup:setup Toggl API token'
16 'install-hooks:install git hooks'
17)
18
19local -a _gh_commands
20_gh_commands=(
21 'feature:create a local branch referencing an open issue'
22 'pr:push the current feature branch and, if needed, open a pull request'
23 'commit:create a commit that closes an open issue'
24 'setup:setup GitHub API token'
25)
26
27local -a _gh_feature_commands
28_gh_feature_commands=(
29 'create:create a new issue for a feature'
30)
31
32_arguments '*:: :->command'
33
34if (( CURRENT == 1 )); then
35 _describe -t commands 'hophop command' _commands
36 return
37fi
38
39if (( CURRENT == 2 )); then
40 case "$words[1]" in
41 gh)
42 _describe 'gh command' _gh_commands ;;
43 toggl)
44 _describe 'toggl command' _toggl_commands ;;
45 esac
46fi
47
48if (( CURRENT == 3 )); then
49 case "$words[2]" in
50 feature)
51 _describe 'gh feature command' _gh_feature_commands ;;
52 esac
53fi