summaryrefslogtreecommitdiffstats
path: root/completions/kcov
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf4acb49ea148cdd899f7f29f1591c7bc853c2135 (patch)
treeb62d60873864065d6428a84a119dd8a3c90f1397 /completions/kcov
parentAdding upstream version 1:2.11. (diff)
downloadbash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.tar.xz
bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.zip
Adding upstream version 1:2.12.0.upstream/1%2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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