aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cppcheck
diff options
context:
space:
mode:
authorGeorgy Komarov <jubnzv@gmail.com>2019-10-24 17:01:08 +0300
committerGeorgy Komarov <jubnzv@gmail.com>2019-10-24 17:01:08 +0300
commit1eb4759854d12617c359caecb6879e3fb0731ba8 (patch)
treecabf7a9f9e94d82314d5ac76776474e2e8a749ff /src/_cppcheck
parentAdd cppcheck support (diff)
downloadzsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar.gz
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar.bz2
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar.lz
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar.xz
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.tar.zst
zsh-completions-1eb4759854d12617c359caecb6879e3fb0731ba8.zip
better completion with filetypes
Diffstat (limited to 'src/_cppcheck')
-rw-r--r--src/_cppcheck9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/_cppcheck b/src/_cppcheck
index c4c1aa1..8506311 100644
--- a/src/_cppcheck
+++ b/src/_cppcheck
@@ -44,13 +44,15 @@
#
# ------------------------------------------------------------------------------
+_cppcheck_files() {
+ _path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
+}
+
_cppcheck() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
- ":command:->command" \
- "*::options:->options" \
"--addon=[Execute addon]" \
"--cppcheck-build-dir=[Analysis output directory]:directory:_files -/" \
"--check-config[Check cppcheck configuration]" \
@@ -97,7 +99,8 @@ _cppcheck() {
{-v,--verbose}"[Output more detailed error information]" \
"--version[Print out version number]" \
"--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 "$@"