synclient: New completion

master
Ville Skyttä 2015-02-06 20:38:39 +02:00
parent edea6cb6da
commit 6a1bf8d114
4 changed files with 44 additions and 0 deletions

View File

@ -348,6 +348,7 @@ bashcomp_DATA = 2to3 \
_svnadmin \
_svnlook \
sync_members \
synclient \
sysbench \
sysctl \
tar \

24
completions/synclient Normal file
View File

@ -0,0 +1,24 @@
# bash completion for synclient(1) -*- shell-script -*-
_synclient()
{
local cur prev words cword split
_init_completion -n = || return
case $prev in
-\?|-h|-V)
return
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
elif [[ $cur != *=?* ]]; then
COMPREPLY=( $( compgen -S = -W '$( $1 -l 2>/dev/null | \
awk "/^[[:space:]]/ { print \$1 }" )' -- "$cur" ) )
compopt -o nospace
fi
} &&
complete -F _synclient synclient
# ex: ts=4 sw=4 et filetype=sh

View File

@ -0,0 +1 @@
assert_source_completions synclient

View File

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