kcov: New completion
This commit is contained in:
parent
3ac922e4a6
commit
a0834d3bf4
@ -73,6 +73,7 @@ bashcomp_DATA = abook \
|
|||||||
jar \
|
jar \
|
||||||
java \
|
java \
|
||||||
k3b \
|
k3b \
|
||||||
|
kcov \
|
||||||
kldload \
|
kldload \
|
||||||
larch \
|
larch \
|
||||||
ldapvi \
|
ldapvi \
|
||||||
|
44
completions/kcov
Normal file
44
completions/kcov
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
have kcov || return
|
||||||
|
|
||||||
|
_kcov()
|
||||||
|
{
|
||||||
|
local cur prev words cword split
|
||||||
|
_init_completion -s || return
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
|
||||||
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
--pid|-p)
|
||||||
|
_pids
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--sort-type|-s)
|
||||||
|
COMPREPLY=( $( compgen -W 'f p' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--include-path|--exclude-path)
|
||||||
|
_filedir
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--limits|-l|--title|-t|--include-pattern|--exclude-pattern)
|
||||||
|
# argument required but no completions available
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return 0
|
||||||
|
|
||||||
|
_filedir
|
||||||
|
} && complete -F _kcov kcov
|
||||||
|
|
||||||
|
# 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
|
1
test/completion/kcov.exp
Normal file
1
test/completion/kcov.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions kcov
|
29
test/lib/completions/kcov.exp
Normal file
29
test/lib/completions/kcov.exp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "kcov "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
set test "--<TAB> should complete all long options"
|
||||||
|
set options [list --help --pid= --sort-type= --limits= --title= --include-path=\
|
||||||
|
--exclude-path= --include-pattern= --exclude-pattern=]
|
||||||
|
assert_complete $options "kcov --" $test
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user