[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 45668c23d37f6dfbf8771866c2a6f85ba3e45e67
Ville Skyttä
ville.skytta at iki.fi
Tue Sep 14 18:05:32 UTC 2010
The following commit has been merged in the master branch:
commit 45668c23d37f6dfbf8771866c2a6f85ba3e45e67
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Sep 14 21:04:36 2010 +0300
Add compgen completion.
diff --git a/CHANGES b/CHANGES
index 0e254a2..46b7ceb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,7 +8,8 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
- * Add crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb completions.
+ * Add compgen, crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb
+ completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
diff --git a/completions/bash-builtins b/completions/bash-builtins
index 75ee1f5..3eba8a1 100644
--- a/completions/bash-builtins
+++ b/completions/bash-builtins
@@ -110,13 +110,14 @@ _complete()
if [[ "$cur" == -* ]]; then
# relevant options completion
- COMPREPLY=( $( compgen -W '-a -b -c -d -e -f -g -j -k -o -s -v -u -A \
- -G -W -P -S -X -F -C' -- "$cur" ) )
+ local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X"
+ [[ $1 != compgen ]] && opts="$opts -F -C"
+ COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
else
COMPREPLY=( $( compgen -A command -- "$cur" ) )
fi
}
-complete -F _complete complete
+complete -F _complete compgen complete
# Local variables:
# mode: shell-script
--
bash-completion
More information about the Bash-completion-commits
mailing list