61 lines
1.6 KiB
Plaintext
Raw Normal View History

# bash completion for cppcheck(1) -*- shell-script -*-
2011-05-01 12:13:32 +03:00
_cppcheck()
{
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
;;
-D|--rule|--suppress|--template)
2011-05-01 12:13:32 +03:00
return
;;
--enable)
COMPREPLY=( $( compgen -W 'all style performance portability
information unusedFunction missingInclude' -- "$cur" ) )
2011-05-01 12:13:32 +03:00
return
;;
--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
;;
--std)
COMPREPLY=( $( compgen -W 'c99 posix' -- "$cur" ) )
return
;;
--platform)
2011-10-30 11:09:13 +02:00
COMPREPLY=( $( compgen -W 'unix32 unix64 win32A win32W win64' \
-- "$cur" ) )
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" ) )
[[ $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