Use compgen -W instead of grepping $cur.

This commit is contained in:
Ville Skyttä 2009-04-18 13:57:36 +03:00
parent ee1f7542de
commit 9bac0313da

View File

@ -14,7 +14,8 @@ _cowsay()
case $prev in
-f)
COMPREPLY=( $( cowsay -l | tail -n +2 | tr " " "\n" | grep "^$cur" ) )
COMPREPLY=( $( compgen -W '$( cowsay -l | tail -n +2 \
)' -- $cur ) )
return 0
;;
esac