wine: Complete all files after an .exe (Alioth #313131)

This commit is contained in:
Igor Murzov 2011-11-17 18:35:49 +03:00
parent 82784121d8
commit 43e8e2b504
5 changed files with 53 additions and 1 deletions

View File

@ -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

View File

@ -305,6 +305,7 @@ bashcomp_DATA = a2x \
vpnc \
watch \
webmitm \
wine \
withlist \
wodim \
wol \

20
completions/wine Normal file
View File

@ -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

1
test/completion/wine.exp Normal file
View File

@ -0,0 +1 @@
assert_source_completions wine

View File

@ -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