Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ The configuration file is written in json, as **run-cppcheck-config.json**. It i
- **log_file**: Path to log file. The default log file location is `$XDG_STATE_HOME/run-cppcheck` or `$HOME/.local/state/run-cppcheck` on Linux,
and `%LOCALAPPDATA%\run-cppcheck` on Windows. The log file may provide more information than the editor plugin if analysis fails.
- **enable_logging**: Default is `true`.
- **args**: Extra arguments to pass to cppcheck. Example: `["--enable=style"]`.
- **extra_args**: Extra arguments to pass to cppcheck. Example: `["--enable=style"]`.
8 changes: 5 additions & 3 deletions config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ std::string Config::load(const std::filesystem::path &path)
continue;
}

if (key == "args") {
if (key == "extra_args") {
if (!value.is<picojson::array>())
return "Invalid value type for '" + key + "'";

Expand Down Expand Up @@ -150,8 +150,10 @@ std::string Config::parseArgs(int argc, char **argv)
continue;
}

if (arg[0] == '-')
return "Invalid option '" + std::string(arg) + "'";
if (arg[0] == '-') {
m_args.push_back(arg);
continue;
}

if (!m_filename.empty())
return "Multiple filenames provided";
Expand Down