Add xmodmap and xrdb completions.

This commit is contained in:
Ville Skyttä 2010-09-14 21:00:31 +03:00
parent 0f426b0774
commit 3b7ed98459
8 changed files with 114 additions and 1 deletions

View File

@ -8,7 +8,7 @@ bash-completion (2.x)
[ Ville Skyttä ] [ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3. * Activate hping2 completion also for hping and hping3.
* Add crontab, iftop, lrzip, and POSIX sh completions. * Add crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer * Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions. filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions. * Add "short" tarball extensions to unxz, unlzma etc completions.

View File

@ -162,7 +162,9 @@ bashcomp_DATA = abook \
xmllint \ xmllint \
xmlwf \ xmlwf \
xmms \ xmms \
xmodmap \
xrandr \ xrandr \
xrdb \
xsltproc \ xsltproc \
xz \ xz \
yp-tools \ yp-tools \

32
completions/xmodmap Normal file
View File

@ -0,0 +1,32 @@
# xmodmap(1) completion
have xmodmap &&
_xmodmap()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-display|-e)
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-display -help -grammar -verbose -quiet -n
-e -pm -pk -pke -pp' -- "$cur" ) )
return 0
fi
_filedir
} &&
complete -F _xmodmap -o filenames xmodmap
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh

37
completions/xrdb Normal file
View File

@ -0,0 +1,37 @@
# xrdb(1) completion
have xrdb &&
_xrdb()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-backup|-display|-help)
return 0
;;
-cpp|-edit)
_filedir
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-help -display -all -global -screen -screens
-n -quiet -cpp -nocpp -symbols -query -load -override -merge
-remove -retain -edit -backup' -- "$cur" ) )
return 0
fi
_filedir
} &&
complete -F _xrdb -o filenames xrdb
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions xmodmap

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

@ -0,0 +1 @@
assert_source_completions xrdb

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "xmodmap "
sync_after_int
teardown

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "xrdb "
sync_after_int
teardown