better completion with filetypes

This commit is contained in:
Georgy Komarov 2019-10-24 17:01:08 +03:00
parent f6eff10118
commit 1eb4759854
1 changed files with 6 additions and 3 deletions

View File

@ -44,13 +44,15 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_cppcheck_files() {
_path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
}
_cppcheck() { _cppcheck() {
local curcontext="$curcontext" state line local curcontext="$curcontext" state line
typeset -A opt_args typeset -A opt_args
_arguments -C \ _arguments -C \
":command:->command" \
"*::options:->options" \
"--addon=[Execute addon]" \ "--addon=[Execute addon]" \
"--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \ "--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \
"--check-config[Check cppcheck configuration]" \ "--check-config[Check cppcheck configuration]" \
@ -97,7 +99,8 @@ _cppcheck() {
{-v,--verbose}"[Output more detailed error information]" \ {-v,--verbose}"[Output more detailed error information]" \
"--version[Print out version number]" \ "--version[Print out version number]" \
"--xml[Write results in xml format to stderr]" \ "--xml[Write results in xml format to stderr]" \
"--xml-version=[Select the XML file version]" "--xml-version=[Select the XML file version]" \
'*: :_cppcheck_files'
} }
_cppcheck "$@" _cppcheck "$@"