Merge pull request #196 from oderwat/SmartUninstallCompletion

Smarter uninstall Bash completion.
This commit is contained in:
Dominik Picheta 2016-01-13 11:14:58 +00:00
commit aa3ee0942e

View file

@ -20,9 +20,12 @@ _nimble()
install)
COMPREPLY=( $( nimble list 2> /dev/null | grep "^$cur" | grep -v '^ ' | tr -d ':') )
;;
path|uninstall)
path)
COMPREPLY=( $( nimble list -i 2> /dev/null | cut -d' ' -f1 | grep "^$cur" ) )
;;
uninstall)
COMPREPLY=( $( nimble list -i 2> /dev/null | awk -F'( |\\[|\\])' '{ f=4; while($f) { l=length($f); if(substr($f, l, l)==",") { $f=substr($f, 0, l-1) }; print $1 "@" $f; f++; }}' | sort -f | grep "^$cur" ) )
;;
list)
COMPREPLY=( $( compgen -W '--ver -i --installed' -- $cur ) )
;;