002a5a4553
Also provide more meaningful completions for --sort-type option. And improve test.
46 lines
1.0 KiB
Bash
46 lines
1.0 KiB
Bash
have kcov || return
|
|
|
|
_kcov()
|
|
{
|
|
local cur prev words cword split
|
|
_init_completion -s || return
|
|
|
|
case "$prev" in
|
|
--pid|-p)
|
|
_pids
|
|
return 0
|
|
;;
|
|
--sort-type|-s)
|
|
COMPREPLY=( $( compgen -W 'filename percentage' -- "$cur" ) )
|
|
return 0
|
|
;;
|
|
--include-path|--exclude-path)
|
|
_filedir
|
|
return 0
|
|
;;
|
|
--limits|-l|--title|-t|--include-pattern|--exclude-pattern|\
|
|
--path-strip-level)
|
|
# argument required but no completions available
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
$split && return 0
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
return 0
|
|
fi
|
|
|
|
_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
|