-
-
Save fschulze/3437687 to your computer and use it in GitHub Desktop.
zsh completion for mr.developer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef develop | |
if [[ "$words[1]" != "$_cache_develop_cmd" ]]; then | |
_cache_develop_cmd="$words[1]" | |
fi | |
_arguments -C \ | |
'(-h --help)'{-h,--help}'[Show help]' \ | |
'(-v --version)'{-v,--version}'[Print version]' \ | |
'*::command:->command' \ | |
&& return 0 | |
case $state in | |
command) | |
if ((CURRENT == 1)); then | |
state=subcommands | |
else | |
state=packagename | |
fi | |
;; | |
esac | |
case $state in | |
subcommands) | |
cmds=($("$_cache_develop_cmd" help -z)) | |
_describe -t commands 'develop commands' cmds | |
;; | |
packagename) | |
packagelist=($("$_cache_develop_cmd" help "$words[1]" -z)) | |
_describe -t commands 'available packages' packagelist | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment