diff --git a/bash_completion b/bash_completion index 2139d6b0..3c2219a8 100644 --- a/bash_completion +++ b/bash_completion @@ -2,7 +2,7 @@ # # # @@ -52,6 +52,7 @@ complete -f -X '!*.+(dvi|DVI)' dvips xdvi dviselect dvitype complete -f -X '!*.+(pdf|PDF)' acroread xpdf complete -f -X '!*.texi*' makeinfo texi2dvi texi2html complete -f -X '!*.+(tex|TEX)' tex latex slitex +complete -f -X '!*.+(mp3|MP3)' mpg123 # FINISH exclude -- do not remove this line # kill sees only signals @@ -1428,7 +1429,7 @@ _file_and_dir() cur=${COMP_WORDS[COMP_CWORD]#-} # get first exclusion compspec that matches this command - xspec=$( grep " $1" /etc/bash_completion | head -1 ) + xspec=$( sed -ne '/ '$1'/{p;q;}' /etc/bash_completion ) # prune to leave nothing but the -X spec xspec=${xspec#*-X } xspec=${xspec%% *} @@ -1448,7 +1449,7 @@ list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' \ done echo ${list[@]} ) -) ) + ) ) # remove previous compspecs eval complete -r ${list[@]} # install new compspecs