cppcheck: Several ids separated by commas can be given for --enable=.
This commit is contained in:
parent
be085fbe23
commit
2c4d20a02e
@ -15,8 +15,16 @@ _cppcheck()
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--enable)
|
--enable)
|
||||||
|
# split comma-separated list
|
||||||
|
split=false
|
||||||
|
if [[ "$cur" == ?*,* ]]; then
|
||||||
|
prev="${cur%,*}"
|
||||||
|
cur="${cur##*,}"
|
||||||
|
split=true
|
||||||
|
fi
|
||||||
COMPREPLY=( $( compgen -W 'all style performance portability
|
COMPREPLY=( $( compgen -W 'all style performance portability
|
||||||
information unusedFunction missingInclude' -- "$cur" ) )
|
information unusedFunction missingInclude' -- "$cur" ) )
|
||||||
|
$split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} )
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--error-exitcode)
|
--error-exitcode)
|
||||||
|
@ -27,4 +27,16 @@ assert_no_complete "cppcheck -D "
|
|||||||
sync_after_int
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete "--enable=all" "cppcheck --enable=al"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete "--enable=xx,style" "cppcheck --enable=xx,styl"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete "--enable=xx,yy,style" "cppcheck --enable=xx,yy,styl"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
teardown
|
teardown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user