synclient: New completion
This commit is contained in:
parent
edea6cb6da
commit
6a1bf8d114
@ -348,6 +348,7 @@ bashcomp_DATA = 2to3 \
|
|||||||
_svnadmin \
|
_svnadmin \
|
||||||
_svnlook \
|
_svnlook \
|
||||||
sync_members \
|
sync_members \
|
||||||
|
synclient \
|
||||||
sysbench \
|
sysbench \
|
||||||
sysctl \
|
sysctl \
|
||||||
tar \
|
tar \
|
||||||
|
24
completions/synclient
Normal file
24
completions/synclient
Normal 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
|
1
test/completion/synclient.exp
Normal file
1
test/completion/synclient.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions synclient
|
18
test/lib/completions/synclient.exp
Normal file
18
test/lib/completions/synclient.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "synclient "
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user