Skip to content

Instantly share code, notes, and snippets.

@Petelin
Created April 1, 2017 02:55
Show Gist options
  • Save Petelin/f67974f2903315b4c77d23793fabbece to your computer and use it in GitHub Desktop.
Save Petelin/f67974f2903315b4c77d23793fabbece to your computer and use it in GitHub Desktop.
zsh补全脚本
### in zsh config
compdef _go go
### 补全脚本
(pycharm_ascle) [~]$ cat .fpath/_go
#compdef go
_1st_arguments=(
"test"
"dev"
"hotfix"
"hotfix1"
"hotfix2"
)
local label_subcommand="launchctl subcommand"
if (( CURRENT == 2 )); then
_describe -t commands "$label_subcommand" _1st_arguments
return 0
fi
_2nd_arguments=(
"gaia"
"athena"
"plutus"
"zeus"
"kefu"
"hera"
"ascle"
"backend"
"mars"
"ship"
)
if (( CURRENT == 3 )); then
_describe -t commands "$label_subcommand" _2nd_arguments
return 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment