[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 942b916aa1e3fc85f2e21bfc079ac29f7142ffdc
Ville Skyttä
ville.skytta at iki.fi
Sat Jan 16 15:30:53 UTC 2010
The following commit has been merged in the master branch:
commit f8eec776e20cf30cbe220c278b9d8ca2b9813336
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Jan 16 16:06:48 2010 +0200
Weed out look completions not starting with current word.
Some versions of the default word list for look may return
non-completable entries (e.g. due to sort order mismatch -- dictionary
vs non-dictionary one, case sensitivity etc -- between sort order in
default word list and look's defaults). As a side effect, fixes also
the test case when a lot of words are returned.
diff --git a/CHANGES b/CHANGES
index 71256a9..aa4ae25 100644
--- a/CHANGES
+++ b/CHANGES
@@ -25,7 +25,7 @@ bash-completion (2.x)
* Apply cardctl completion to pccardctl too.
* Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist.
- * Improve chsh, configure, cvs, gkrellm, lftp, mdadm, modprobe, mplayer,
+ * Improve chsh, configure, cvs, gkrellm, lftp, look, mdadm, modprobe, mplayer,
mysqladmin, rsync, screen, service, scp, ssh, sshfs, update-alternatives,
vncviewer, yp-tools, and general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz.
diff --git a/bash_completion b/bash_completion
index 814c876..6478062 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1622,7 +1622,7 @@ _look()
cur=`_get_cword`
if [ $COMP_CWORD = 1 ]; then
- COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' ) )
+ COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) )
fi
} &&
complete -F _look -o default look
diff --git a/test/lib/completions/look.exp b/test/lib/completions/look.exp
index 4224c32..53a3c46 100644
--- a/test/lib/completions/look.exp
+++ b/test/lib/completions/look.exp
@@ -11,7 +11,9 @@ proc teardown {} {
setup
-assert_complete_any "look foo"
+if {[assert_exec {look foo | grep ^foo} words]} {
+ assert_complete $words "look foo"
+}; # if
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list