From 6111779682edfe081a33c0f1a3cb90ca608ec74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mindaugas=20Moz=C5=ABras?= Date: Thu, 17 Mar 2011 19:04:13 +0200 Subject: [PATCH] Added all commands to npm plugin --- plugins/npm/_npm | 64 ++++++++++++++++++++++++++++++++++++++ plugins/npm/npm.plugin.zsh | 4 +++ 2 files changed, 68 insertions(+) create mode 100644 plugins/npm/_npm create mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/npm/_npm b/plugins/npm/_npm new file mode 100644 index 000000000..f5c00ec77 --- /dev/null +++ b/plugins/npm/_npm @@ -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 diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh new file mode 100644 index 000000000..826f0f7b0 --- /dev/null +++ b/plugins/npm/npm.plugin.zsh @@ -0,0 +1,4 @@ +# add npm completion function to path +fpath=($ZSH/plugins/npm $fpath) +autoload -U compinit +compinit -i