Skip to content

Instantly share code, notes, and snippets.

@esteele
Created August 19, 2012 19:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esteele/3397113 to your computer and use it in GitHub Desktop.
Save esteele/3397113 to your computer and use it in GitHub Desktop.
zsh completion for mr.developer
#compdef develop
local subcmds
subcmds=(
'activate'
'checkout'
'deactivate'
'help'
'info'
'list'
'purge'
'rebuild'
'reset'
'status'
'update'
)
_arguments -C \
"-h, --help show this help message and exit." \
"-a, --auto-checkout Only considers packages declared by auto-checkout. If you don't specify a <package-regexps> then all declared packages are processed." \
"-c, --checked-out Only considers packages currently checked out. If you don't specify a <package-regexps> then all checked out packages are processed." \
"-d, --develop Only considers packages currently in development mode. If you don't specify a <package-regexps> then all develop packages are processed." \
"-v, --verbose Show output of VCS command." \
"*::command:->command" \
&& return 0
case $state in
command)
if ((CURRENT == 1)); then
state=subcommands
else
state=packagename
fi
;;
esac
case $state in
subcommands)
_describe -t commands 'develop commands' subcmds
;;
packagename)
activepackagelist=($(bin/develop list))
_describe -t commands 'available packages' activepackagelist
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment