summaryrefslogtreecommitdiff
path: root/completions/cppcheck
diff options
context:
space:
mode:
Diffstat (limited to 'completions/cppcheck')
-rw-r--r--completions/cppcheck28
1 files changed, 20 insertions, 8 deletions
diff --git a/completions/cppcheck b/completions/cppcheck
index 64bb9b02..86990dd5 100644
--- a/completions/cppcheck
+++ b/completions/cppcheck
@@ -6,12 +6,13 @@ _cppcheck()
_init_completion -s || return
case $prev in
- --append|--exitcode-suppressions|--file-list|--rule-file|\
+ --append|--exitcode-suppressions|--rule-file|--config-excludes-file|\
--suppressions-list|--includes-file|--include|-i)
_filedir
return
;;
- -D|-U|--rule|--suppress|--template|--max-configs)
+ -D|-U|--rule|--suppress|--template|--max-configs|-h|--help|--version|\
+ --errorlist|--config-exclude|-l)
return
;;
--enable)
@@ -22,8 +23,9 @@ _cppcheck()
cur="${cur##*,}"
split=true
fi
- COMPREPLY=( $( compgen -W 'all style performance portability
- information unusedFunction missingInclude' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W 'all warning style performance
+ portability information unusedFunction missingInclude' \
+ -- "$cur" ) )
$split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} )
return
;;
@@ -31,6 +33,11 @@ _cppcheck()
COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) )
return
;;
+ --file-list)
+ _filedir
+ [[ -z $cur || $cur == - ]] && COMPREPLY+=( - )
+ return
+ ;;
-I)
_filedir -d
return
@@ -49,8 +56,9 @@ _cppcheck()
return
;;
--platform)
- COMPREPLY=( $( compgen -W 'unix32 unix64 win32A win32W win64' \
- -- "$cur" ) )
+ _filedir
+ COMPREPLY+=( $( compgen -W 'unix32 unix64 win32A win32W win64
+ native' -- "$cur" ) )
return
;;
-rp|--relative-paths)
@@ -59,6 +67,10 @@ _cppcheck()
return
fi
;;
+ --library)
+ _filedir cfg
+ return
+ ;;
--xml-version)
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
return
@@ -71,9 +83,9 @@ _cppcheck()
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
else
- _filedir @(cpp|cxx|cc|c++|c|h|hpp|hxx|h++|tpp|txx)
+ _filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])'
fi
} &&
complete -F _cppcheck cppcheck
-# ex: ts=4 sw=4 et filetype=sh
+# ex: filetype=sh