cppcheck: Several ids separated by commas can be given for --enable=.

This commit is contained in:
Igor Murzov 2011-12-14 19:23:55 +04:00
parent be085fbe23
commit 2c4d20a02e
2 changed files with 20 additions and 0 deletions

View File

@ -15,8 +15,16 @@ _cppcheck()
return
;;
--enable)
# split comma-separated list
split=false
if [[ "$cur" == ?*,* ]]; then
prev="${cur%,*}"
cur="${cur##*,}"
split=true
fi
COMPREPLY=( $( compgen -W 'all style performance portability
information unusedFunction missingInclude' -- "$cur" ) )
$split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} )
return
;;
--error-exitcode)

View File

@ -27,4 +27,16 @@ assert_no_complete "cppcheck -D "
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