#compdef hophop local -a _commands _commands=( 'gh:GitHub workflow commands' 'toggl:Toggl time tracker commands' ) local -a _toggl_commands _toggl_commands=( 'start:start time tracking for the current issue' 'misc:start time tracking for generic task' 'test:start time tracking for test task' 'stop:stop time tracking' 'setup:setup Toggl API token' 'install-hooks:install git hooks' ) local -a _gh_commands _gh_commands=( 'feature:create a local branch referencing an open issue' 'pr:push the current feature branch and, if needed, open a pull request' 'commit:create a commit that closes an open issue' 'setup:setup GitHub API token' ) local -a _gh_feature_commands _gh_feature_commands=( 'create:create a new issue for a feature' ) _arguments '*:: :->command' if (( CURRENT == 1 )); then _describe -t commands 'hophop command' _commands return fi if (( CURRENT == 2 )); then case "$words[1]" in gh) _describe 'gh command' _gh_commands ;; toggl) _describe 'toggl command' _toggl_commands ;; esac fi if (( CURRENT == 3 )); then case "$words[2]" in feature) _describe 'gh feature command' _gh_feature_commands ;; esac fi