[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-49-g43e8e2b
Igor Murzov
e-mail at date.by
Thu Nov 17 14:41:09 UTC 2011
The following commit has been merged in the master branch:
commit 43e8e2b5045cd5ee702e867a7cf9757287bdf755
Author: Igor Murzov <e-mail at date.by>
Date: Thu Nov 17 18:35:49 2011 +0300
wine: Complete all files after an .exe (Alioth #313131)
diff --git a/bash_completion b/bash_completion
index bae27ea..56226f6 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1847,7 +1847,6 @@ _install_xspec '!*.@(mid?(i)|cmf)' playmidi
_install_xspec '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
_install_xspec '!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid?(i)|mt[2m]|okta|p[st]m|s[3t]m|ult|umx|wav|xm)' modplugplay modplug123
_install_xspec '*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
-_install_xspec '!*.@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR])' wine
_install_xspec '!*.@(zip|z|gz|tgz)' bzme
# konqueror not here on purpose, it's more than a web/html browser
_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 66f0eeb..c6ff1ec 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -305,6 +305,7 @@ bashcomp_DATA = a2x \
vpnc \
watch \
webmitm \
+ wine \
withlist \
wodim \
wol \
diff --git a/completions/wine b/completions/wine
new file mode 100644
index 0000000..58e4cf4
--- /dev/null
+++ b/completions/wine
@@ -0,0 +1,20 @@
+# bash completion for wine(1) -*- shell-script -*-
+
+_wine()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cword" -eq 1 ]]; then
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '--help --version' -- "$cur") )
+ [[ $COMPREPLY ]] && return
+ fi
+ _filedir '[eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]'
+ else
+ _filedir
+ fi
+} &&
+complete -F _wine wine
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/wine.exp b/test/completion/wine.exp
new file mode 100644
index 0000000..ddb1e6f
--- /dev/null
+++ b/test/completion/wine.exp
@@ -0,0 +1 @@
+assert_source_completions wine
diff --git a/test/lib/completions/wine.exp b/test/lib/completions/wine.exp
new file mode 100644
index 0000000..2cc60c4
--- /dev/null
+++ b/test/lib/completions/wine.exp
@@ -0,0 +1,31 @@
+proc setup {} {
+ save_env
+}
+
+
+proc teardown {} {
+ assert_env_unmodified {/OLDPWD=/d}
+}
+
+
+setup
+
+
+set test "should complete *.exe, *.com files and dirs"
+set dir $::srcdir/fixtures/shared/default
+assert_complete_dir {"bar bar.d/" foo.d/} "wine " $dir $test
+
+
+sync_after_int
+
+
+set test "should complete any files and dirs after executable"
+set dir $::srcdir/fixtures/shared/default
+set files {bar "bar bar.d/" foo foo.d/}
+assert_complete_dir $files "wine notepad " $dir $test
+
+
+sync_after_int
+
+
+teardown
--
bash-completion
More information about the Bash-completion-commits
mailing list