Added all commands to npm plugin

This commit is contained in:
Mindaugas Mozūras 2011-03-17 19:04:13 +02:00
commit 6111779682
2 changed files with 68 additions and 0 deletions

64
plugins/npm/_npm Normal file
View file

@ -0,0 +1,64 @@
#compdef npm
#autoload
# npm zsh completion, based on brew completion plugin
local -a _1st_arguments
_1st_arguments=(
'activate:'
'adduser:'
'bn:'
'bundle:'
'c:'
'cache:'
'config:'
'deactivate:'
'deprecate:'
'docs:'
'edit:'
'explore:'
'faq:'
'find:'
'get:'
'help:'
'i:'
'info:'
'init:'
'install:'
'link:'
'list:'
'ln:'
'ls:'
'outdated:'
'owner:'
'publish:'
'r:'
'rb:'
'rebuild:'
'rm:'
'run-script:'
'search:'
'set:'
'start:'
'stop:'
'tag:'
'test:'
'un:'
'uninstall:'
'unpublish:'
'up:'
'update:'
'version:'
'view:'
'xmas:'
)
local expl
_arguments \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "npm subcommand" _1st_arguments
return
fi

View file

@ -0,0 +1,4 @@
# add npm completion function to path
fpath=($ZSH/plugins/npm $fpath)
autoload -U compinit
compinit -i