Use compgen -W instead of grepping $cur.
This commit is contained in:
parent
ee1f7542de
commit
9bac0313da
@ -14,7 +14,8 @@ _cowsay()
|
|||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
-f)
|
-f)
|
||||||
COMPREPLY=( $( cowsay -l | tail -n +2 | tr " " "\n" | grep "^$cur" ) )
|
COMPREPLY=( $( compgen -W '$( cowsay -l | tail -n +2 \
|
||||||
|
)' -- $cur ) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user