Recognize long equivalents to -f and -C when looking for Makefile or dir option.

This commit is contained in:
Ville Skyttä 2010-01-19 23:14:46 +02:00
parent 7e03431ed7
commit e24fc84c8d
2 changed files with 6 additions and 6 deletions

View File

@ -25,8 +25,8 @@ bash-completion (2.x)
* Apply cardctl completion to pccardctl too. * Apply cardctl completion to pccardctl too.
* Apply pine completion to alpine too. * Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist. * Remove many unnecessary short option completions where long ones exist.
* Improve chsh, configure, cvs, gkrellm, gzip, lftp, look, mdadm, modprobe, * Improve chsh, configure, cvs, gkrellm, gzip, lftp, look, make, mdadm,
mplayer, mysqladmin, rsync, screen, service, scp, ssh, sshfs, modprobe, mplayer, mysqladmin, rsync, screen, service, scp, ssh, sshfs,
update-alternatives, vncviewer, yp-tools, and general hostname completions. update-alternatives, vncviewer, yp-tools, and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz. * Add abook and wtf completion, based on work by Raphaël Droz.
* Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake, * Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, pm-utils, rtcwake,

View File

@ -39,9 +39,9 @@ _make()
--warn-undefined-variables' -- "$cur" ) ) --warn-undefined-variables' -- "$cur" ) )
else else
# before we check for makefiles, see if a path was specified # before we check for makefiles, see if a path was specified
# with -C # with -C/--directory
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
if [[ ${COMP_WORDS[i]} == -C ]]; then if [[ ${COMP_WORDS[i]} == -@(C|-directory) ]]; then
# eval for tilde expansion # eval for tilde expansion
eval makef_dir=${COMP_WORDS[i+1]} eval makef_dir=${COMP_WORDS[i+1]}
break break
@ -49,9 +49,9 @@ _make()
done done
# before we scan for targets, see if a Makefile name was # before we scan for targets, see if a Makefile name was
# specified with -f # specified with -f/--file/--makefile
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
if [[ ${COMP_WORDS[i]} == -f ]]; then if [[ ${COMP_WORDS[i]} == -@(f|-?(make)file) ]]; then
# eval for tilde expansion # eval for tilde expansion
eval makef=${COMP_WORDS[i+1]} eval makef=${COMP_WORDS[i+1]}
break break