2011-11-01 22:14:45 +02:00
|
|
|
# bash completion for cppcheck(1) -*- shell-script -*-
|
2011-05-01 12:13:32 +03:00
|
|
|
|
|
|
|
_cppcheck()
|
|
|
|
{
|
2011-05-01 22:18:40 +03:00
|
|
|
local cur prev words cword split
|
|
|
|
_init_completion -s || return
|
2011-05-01 12:13:32 +03:00
|
|
|
|
|
|
|
case $prev in
|
|
|
|
--append|--exitcode-suppressions|--file-list|--rule-file|\
|
2011-09-21 03:31:52 +04:00
|
|
|
--suppressions-list|-i)
|
2011-05-01 12:13:32 +03:00
|
|
|
_filedir
|
|
|
|
return
|
|
|
|
;;
|
2011-10-30 11:06:13 +02:00
|
|
|
-D|--rule|--suppress|--template)
|
2011-05-01 12:13:32 +03:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
--enable)
|
2011-09-16 20:55:03 +04:00
|
|
|
COMPREPLY=( $( compgen -W 'all style performance portability
|
|
|
|
information unusedFunction missingInclude' -- "$cur" ) )
|
2011-05-01 12:13:32 +03:00
|
|
|
return
|
|
|
|
;;
|
2011-05-02 10:28:38 +03:00
|
|
|
--error-exitcode)
|
2011-05-01 12:13:32 +03:00
|
|
|
COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
2011-09-21 03:31:52 +04:00
|
|
|
-I)
|
2011-05-01 12:13:32 +03:00
|
|
|
_filedir -d
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-j)
|
|
|
|
COMPREPLY=( $( compgen -W '{2..16}' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
2011-09-16 21:06:25 +04:00
|
|
|
--std)
|
2011-10-09 22:18:38 +04:00
|
|
|
COMPREPLY=( $( compgen -W 'c99 posix' -- "$cur" ) )
|
2011-09-16 21:06:25 +04:00
|
|
|
return
|
|
|
|
;;
|
2011-09-21 03:46:37 +04:00
|
|
|
--platform)
|
2011-10-30 11:09:13 +02:00
|
|
|
COMPREPLY=( $( compgen -W 'unix32 unix64 win32A win32W win64' \
|
|
|
|
-- "$cur" ) )
|
2011-09-21 03:46:37 +04:00
|
|
|
return
|
|
|
|
;;
|
2011-05-01 12:13:32 +03:00
|
|
|
--xml-version)
|
|
|
|
COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
$split && return
|
|
|
|
|
|
|
|
if [[ $cur == -* ]]; then
|
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
2011-10-30 11:07:38 +02:00
|
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
2011-05-01 12:13:32 +03:00
|
|
|
else
|
|
|
|
_filedir @(cpp|cxx|cc|c++|c|tpp|txx)
|
|
|
|
fi
|
|
|
|
} &&
|
|
|
|
complete -F _cppcheck cppcheck
|
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|