Skip to content

Commit 2157f1c

Browse files
committed
refactor(cppcheck): use _comp_delimited
1 parent 7777278 commit 2157f1c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

completions/cppcheck

+2-11
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,8 @@ _comp_cmd_cppcheck()
1616
return
1717
;;
1818
--enable)
19-
# split comma-separated list
20-
local split=""
21-
if [[ $cur == ?*,* ]]; then
22-
prev="${cur%,*}"
23-
cur="${cur##*,}"
24-
split="set"
25-
fi
26-
_comp_compgen -- -W 'all warning style performance portability
27-
information unusedFunction missingInclude' &&
28-
[[ $split ]] &&
29-
_comp_compgen -Rv COMPREPLY -- -P "$prev," -W '"${COMPREPLY[@]}"'
19+
_comp_delimited , -W 'all warning style performance portability
20+
information unusedFunction missingInclude'
3021
return
3122
;;
3223
--error-exitcode)

0 commit comments

Comments
 (0)