ccache: New completion.
This commit is contained in:
parent
f0283e1c1b
commit
ed17034974
@ -28,6 +28,7 @@ bashcomp_DATA = a2x \
|
||||
cal \
|
||||
cancel \
|
||||
cardctl \
|
||||
ccache \
|
||||
cfagent \
|
||||
cfrun \
|
||||
chage \
|
||||
|
26
completions/ccache
Normal file
26
completions/ccache
Normal file
@ -0,0 +1,26 @@
|
||||
# ccache(1) completion -*- shell-script -*-
|
||||
|
||||
_ccache()
|
||||
{
|
||||
local cur prev words cword split
|
||||
_init_completion -s || return
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 && ${COMP_WORDS[COMP_CWORD]} != -* ]]; then
|
||||
_command_offset 1
|
||||
return
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
-h|--help|-V|--version|-F|--max-files|-M|--max-size)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return
|
||||
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||
} &&
|
||||
complete -F _ccache ccache
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/ccache.exp
Normal file
1
test/completion/ccache.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions ccache
|
18
test/lib/completions/ccache.exp
Normal file
18
test/lib/completions/ccache.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "ccache -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user