[Bash-completion-devel] [PATCH 3/4] mplayer: fix profile names completion.
Anton Khirnov
wyskas at gmail.com
Wed Jul 7 16:44:34 UTC 2010
unlike other '-foo help' style options for which the first line is
mplayer copyright info followed by ^Available line, -profile help
outputs first the list of profile names and copyirght info is actually
the last line.
---
contrib/mplayer | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/mplayer b/contrib/mplayer
index 1f8a4ac..e74db5e 100644
--- a/contrib/mplayer
+++ b/contrib/mplayer
@@ -5,7 +5,7 @@ _mplayer_options_list()
{
cur=${cur%\\}
COMPREPLY=( $( compgen -W "$( $1 -nomsgcolor -nomsgmodule $2 help 2>/dev/null | \
- sed -e '1,/^Available/d' | awk '{print $1}' | \
+ sed -e '/^Available/,/^$/!d' -e '/^Available/d' | awk '{print $1}' | \
sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' )" -- "$cur" ) )
}
--
1.7.1
More information about the Bash-completion-devel
mailing list