2011-12-19 00:24:14 +04:00
|
|
|
# kcov(1) completion -*- shell-script -*-
|
2011-11-01 22:14:45 +02:00
|
|
|
|
2011-06-06 01:06:25 +04:00
|
|
|
_kcov()
|
|
|
|
{
|
|
|
|
local cur prev words cword split
|
2013-04-06 03:40:32 +04:00
|
|
|
_init_completion -s -n : || return
|
2011-06-06 01:06:25 +04:00
|
|
|
|
|
|
|
case "$prev" in
|
|
|
|
--pid|-p)
|
|
|
|
_pids
|
2011-11-20 17:00:03 +03:00
|
|
|
return
|
2011-06-06 01:06:25 +04:00
|
|
|
;;
|
|
|
|
--sort-type|-s)
|
2013-04-06 03:40:32 +04:00
|
|
|
COMPREPLY=( $( compgen -W 'filename percent reverse lines
|
|
|
|
uncovered' -- "$cur" ) )
|
2011-11-20 17:00:03 +03:00
|
|
|
return
|
2011-06-06 01:06:25 +04:00
|
|
|
;;
|
|
|
|
--include-path|--exclude-path)
|
|
|
|
_filedir
|
2011-11-20 17:00:03 +03:00
|
|
|
return
|
2011-06-06 01:06:25 +04:00
|
|
|
;;
|
2013-04-06 03:40:32 +04:00
|
|
|
--replace-src-path)
|
|
|
|
if [[ "$cur" == ?*:* ]]; then
|
|
|
|
cur="${cur##*:}"
|
|
|
|
_filedir
|
|
|
|
else
|
|
|
|
_filedir
|
|
|
|
compopt -o nospace
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
;;
|
2012-07-05 01:01:50 +04:00
|
|
|
--limits|-l)
|
|
|
|
if [[ "$cur" == ?*,* ]]; then
|
|
|
|
prev="${cur%,*}"
|
|
|
|
cur="${cur##*,}"
|
2013-04-06 03:40:32 +04:00
|
|
|
COMPREPLY=( $( compgen -P "$prev," -W "{0..100}" -- "$cur" ) )
|
2012-07-05 01:01:50 +04:00
|
|
|
else
|
2013-04-06 03:40:32 +04:00
|
|
|
COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) )
|
2012-07-05 01:01:50 +04:00
|
|
|
compopt -o nospace
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
--title|-t|--include-pattern|--exclude-pattern|--path-strip-level)
|
2011-06-06 01:06:25 +04:00
|
|
|
# argument required but no completions available
|
2011-11-20 17:00:03 +03:00
|
|
|
return
|
2011-06-06 01:06:25 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2011-11-20 17:00:03 +03:00
|
|
|
$split && return
|
2011-06-06 01:06:25 +04:00
|
|
|
|
2011-06-08 04:02:34 +04:00
|
|
|
if [[ "$cur" == -* ]]; then
|
2011-11-20 23:42:20 +03:00
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
|
2011-06-08 04:02:34 +04:00
|
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
2011-11-20 17:00:03 +03:00
|
|
|
return
|
2011-06-08 04:02:34 +04:00
|
|
|
fi
|
|
|
|
|
2011-06-06 01:06:25 +04:00
|
|
|
_filedir
|
|
|
|
} && complete -F _kcov kcov
|
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|