summaryrefslogtreecommitdiffstats
path: root/completions/kcov
diff options
context:
space:
mode:
Diffstat (limited to 'completions/kcov')
-rw-r--r--completions/kcov34
1 files changed, 16 insertions, 18 deletions
diff --git a/completions/kcov b/completions/kcov
index 672967a..20a62f2 100644
--- a/completions/kcov
+++ b/completions/kcov
@@ -1,30 +1,28 @@
# kcov(1) completion -*- shell-script -*-
-_kcov()
+_comp_cmd_kcov()
{
- local cur prev words cword split
- _init_completion -s -n : || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -n : -- "$@" || return
case "$prev" in
--pid | -p)
- _pids
+ _comp_compgen_pids
return
;;
--sort-type | -s)
- COMPREPLY=($(compgen -W 'filename percent reverse lines
- uncovered' -- "$cur"))
+ _comp_compgen -- -W 'filename percent reverse lines uncovered'
return
;;
--include-path | --exclude-path)
- _filedir
+ _comp_compgen_filedir
return
;;
--replace-src-path)
if [[ $cur == ?*:* ]]; then
- cur="${cur##*:}"
- _filedir
+ _comp_compgen -c "${cur##*:}" filedir
else
- _filedir
+ _comp_compgen_filedir
compopt -o nospace
fi
return
@@ -33,12 +31,12 @@ _kcov()
if [[ $cur == ?*,* ]]; then
prev="${cur%,*}"
cur="${cur##*,}"
- COMPREPLY=($(compgen -W "{0..100}" -- "$cur"))
+ _comp_compgen -- -W "{0..100}"
((${#COMPREPLY[@]} == 1)) &&
- COMPREPLY=(${COMPREPLY/#/$prev,})
+ _comp_compgen -Rv COMPREPLY -- -P "$prev," -W '"$COMPREPLY"'
else
- COMPREPLY=($(compgen -W "{0..100}" -- "$cur"))
- ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/%/,})
+ _comp_compgen -- -W "{0..100}"
+ ((${#COMPREPLY[@]} == 1)) && COMPREPLY=("${COMPREPLY/%/,}")
compopt -o nospace
fi
return
@@ -49,16 +47,16 @@ _kcov()
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur"))
+ _comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
return
fi
- _filedir
+ _comp_compgen_filedir
} &&
- complete -F _kcov kcov
+ complete -F _comp_cmd_kcov kcov
# ex: filetype=sh