summaryrefslogtreecommitdiffstats
path: root/completions/cppcheck
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
commit6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch)
tree0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/cppcheck
parentReleasing progress-linux version 1:2.11-8~progress7.99u1. (diff)
downloadbash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz
bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/cppcheck')
-rw-r--r--completions/cppcheck58
1 files changed, 29 insertions, 29 deletions
diff --git a/completions/cppcheck b/completions/cppcheck
index 8ea9571..5867fc7 100644
--- a/completions/cppcheck
+++ b/completions/cppcheck
@@ -1,14 +1,14 @@
# bash completion for cppcheck(1) -*- shell-script -*-
-_cppcheck()
+_comp_cmd_cppcheck()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
case $prev in
--append | --exitcode-suppressions | --rule-file | --config-excludes-file | \
--suppressions-list | --includes-file | --include | -i)
- _filedir
+ _comp_compgen_filedir
return
;;
-D | -U | --rule | --suppress | --template | --max-configs | -h | --help | --version | \
@@ -17,75 +17,75 @@ _cppcheck()
;;
--enable)
# split comma-separated list
- split=false
+ local split=""
if [[ $cur == ?*,* ]]; then
prev="${cur%,*}"
cur="${cur##*,}"
- split=true
+ split="set"
fi
- COMPREPLY=($(compgen -W 'all warning style performance
- portability information unusedFunction missingInclude' \
- -- "$cur"))
- $split && COMPREPLY=(${COMPREPLY[@]/#/"$prev,"})
+ _comp_compgen -- -W 'all warning style performance portability
+ information unusedFunction missingInclude' &&
+ [[ $split ]] &&
+ _comp_compgen -Rv COMPREPLY -- -P "$prev," -W '"${COMPREPLY[@]}"'
return
;;
--error-exitcode)
- COMPREPLY=($(compgen -W '{0..255}' -- "$cur"))
+ _comp_compgen -- -W '{0..255}'
return
;;
--file-list)
- _filedir
- [[ -z $cur || $cur == - ]] && COMPREPLY+=(-)
+ _comp_compgen_filedir
+ [[ ! $cur || $cur == - ]] && COMPREPLY+=(-)
return
;;
-I)
- _filedir -d
+ _comp_compgen_filedir -d
return
;;
-j)
- COMPREPLY=($(compgen -W "{2..$(_ncpus)}" -- "$cur"))
+ local REPLY
+ _comp_get_ncpus
+ _comp_compgen -- -W "{1..$REPLY}"
return
;;
--language | -x)
- COMPREPLY=($(compgen -W 'c c++' -- "$cur"))
+ _comp_compgen -- -W 'c c++'
return
;;
--std)
- COMPREPLY=($(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17
- c++20' -- "$cur"))
+ _comp_compgen -- -W 'c89 c99 c11 c++03 c++11 c++14 c++17 c++20'
return
;;
--platform)
- _filedir
- COMPREPLY+=($(compgen -W 'unix32 unix64 win32A win32W win64
- native' -- "$cur"))
+ _comp_compgen_filedir
+ _comp_compgen -a -- -W 'unix32 unix64 win32A win32W win64 native'
return
;;
-rp | --relative-paths)
- if $split; then # -rp without argument is allowed
- _filedir -d
+ if [[ $was_split ]]; then # -rp without argument is allowed
+ _comp_compgen_filedir -d
return
fi
;;
--library)
- _filedir cfg
+ _comp_compgen_filedir cfg
return
;;
--xml-version)
- COMPREPLY=($(compgen -W '1 2' -- "$cur"))
+ _comp_compgen -- -W '1 2'
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ _comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
else
- _filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])'
+ _comp_compgen_filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])'
fi
} &&
- complete -F _cppcheck cppcheck
+ complete -F _comp_cmd_cppcheck cppcheck
# ex: filetype=sh