[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1b248b55021318e653a0ca81145829c9dc77c97b
Ville Skyttä
ville.skytta at iki.fi
Sat Oct 23 11:39:36 UTC 2010
The following commit has been merged in the master branch:
commit 1b248b55021318e653a0ca81145829c9dc77c97b
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Oct 23 14:36:11 2010 +0300
Make mkdir complete only on dirs.
diff --git a/CHANGES b/CHANGES
index 575baad..b2abbc6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -14,8 +14,8 @@ bash-completion (2.x)
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
and *.awb to mplayer filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
- * Improve /etc/init.d/*, ipmitool, jar, mencoder, mplayer, povray, sqlite3,
- wodim, and general help parsing completions.
+ * Improve /etc/init.d/*, ipmitool, jar, mencoder, mkdir, mplayer, povray,
+ sqlite3, wodim, and general help parsing completions.
* Fix p4 and povray completions (Alioth: #312625).
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.
* Recognize rpm query mode based on the --file, --group, --package, and
diff --git a/bash_completion b/bash_completion
index fe99f90..24c9d3f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1507,7 +1507,7 @@ _longopt()
COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}\).*/\1/p' | sort -u )" \
-- "$cur" ) )
- elif [[ "$1" == rmdir ]]; then
+ elif [[ "$1" == @(mk|rm)dir ]]; then
_filedir -d
else
_filedir
diff --git a/test/lib/completions/mkdir.exp b/test/lib/completions/mkdir.exp
index a933356..4fc7b80 100644
--- a/test/lib/completions/mkdir.exp
+++ b/test/lib/completions/mkdir.exp
@@ -17,4 +17,10 @@ assert_complete_any "mkdir "
sync_after_int
+assert_complete {"bar bar.d/" foo.d/} "mkdir fixtures/shared/default/"
+
+
+sync_after_int
+
+
teardown
--
bash-completion
More information about the Bash-completion-commits
mailing list