Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (29 sloc) 0.968 kb
cef89a2 @isaacs Initial bash completion support. Very rudimentary.
isaacs authored
1 #
2 # npm command completion script
3 #
4 # Install Method 1: Automatic
5 # Drop this file in /etc/bash-completion.d or /usr/local/etc/bash-completion.d
6 # or wherever bash-completion scripts are sourced on your system.
7 #
8 # Install Method 2: Generic
9 # Put this in your .bashrc or whatever file you run when you log into a machine:
10 # . path/to/npm-completion.sh
11 #
12 # Then use the tab key to complete commands, which executes the "npm completion"
13 # command.
14 #
15 # Note that command completion is very rudimentary and incomplete (harhar) as of
16 # this time. Patches welcome!
17 #
18 # --i
19
20 __npm_completion () {
21 COMPREPLY=()
22 local cur prev opts
23 cur="${COMP_WORDS[COMP_CWORD]}"
24 prev="${COMP_WORDS[COMP_CWORD-1]}"
25 # opts=$(npm complete --loglevel silent --color false -- "$cur")
26 COMPREPLY=( $(COMP_CWORD=${COMP_CWORD} npm completion --loglevel silent --color false \
27 -- "${COMP_WORDS[@]}" ) )
28 return $?
29 }
30
31 complete -o default -o nospace -F __npm_completion npm
Something went wrong with that request. Please try again.