[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 56996e5e6d0654f164f372a5511d9b0b9f17145e
Ville Skyttä
ville.skytta at iki.fi
Sat Apr 18 19:41:56 UTC 2009
The following commit has been merged in the master branch:
commit 2e66656e682a8fc469c9de4c3eaeb61b2c095d33
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Apr 18 22:37:46 2009 +0300
Use compgen -W instead of grepping $cur.
diff --git a/contrib/mplayer b/contrib/mplayer
index 80880b9..e5a6f6e 100644
--- a/contrib/mplayer
+++ b/contrib/mplayer
@@ -7,10 +7,9 @@ have mplayer && {
_mplayer_options_list()
{
cur=${cur%\\}
- COMPREPLY=( $( $1 $2 help 2> /dev/null | \
+ COMPREPLY=( $( compgen -W "$( $1 $2 help 2>/dev/null | \
sed -e '1,/^Available/d' | awk '{print $1}' | \
- sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' | \
- grep "^$cur" ) )
+ sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' )" -- $cur ) )
}
_mplayer()
--
bash-completion
More information about the Bash-completion-commits
mailing list