Permalink
Browse files

Add completions

  • Loading branch information...
1 parent 734cb3f commit fea474e89774b2dccaa6f9d16401f2ad2b59a302 @hokaccha committed Nov 30, 2013
Showing with 4 additions and 3 deletions.
  1. +2 −2 completions/bash/nodebrew-completion
  2. +2 −1 completions/zsh/_nodebrew
@@ -3,7 +3,7 @@
_nodebrew()
{
local opts cur prev
- opts="alias unalias ls ls-all ls-remote list install install-binary uninstall use clean selfupdate migrate-package help"
+ opts="alias unalias ls ls-all ls-remote list install install-binary uninstall use clean selfupdate migrate-package exec help"
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@@ -16,7 +16,7 @@ _nodebrew()
_alias=$(nodebrew alias 2> /dev/null | sed 's/->.*//')
case "${prev}" in
- use|migrate-package)
+ use|migrate-package|exec)
local target
target="${_versions} ${_alias}"
COMPREPLY=( $(compgen -W "${target}" ${cur} ) )
@@ -25,6 +25,7 @@ case $state in
'clean:Remove source file'
'selfupdate:Update nodebrew'
'migrate-package:Install global NPM packages contained in version to current version'
+ 'exec:Execute command specified version'
)
_describe -t commands 'nodebrew commands' _cmds && ret=0
;;
@@ -33,7 +34,7 @@ case $state in
_versions=( $(_call_program commands nodebrew ls 2>/dev/null | grep '^v') )
_alias=( $(_call_program commands nodebrew alias 2>/dev/null | sed 's/->.*//') )
case $line[1] in
- use|migrate-package)
+ use|migrate-package|exec)
_describe -t versions 'versions' _versions && ret=0
_describe -t alias 'alias' _alias && ret=0
;;

0 comments on commit fea474e

Please sign in to comment.