Skip to content

Commit

Permalink
Merge pull request #196 from oderwat/SmartUninstallCompletion
Browse files Browse the repository at this point in the history
Smarter uninstall Bash completion.
  • Loading branch information
dom96 committed Jan 13, 2016
2 parents 08b58c7 + c6d8742 commit aa3ee09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nimble.bash-completion
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) )
;;
Expand Down

0 comments on commit aa3ee09

Please sign in to comment.