Removed deprecated command --append
This commit is contained in:
parent
fda1f67da6
commit
3432257390
|
@ -296,18 +296,6 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
else if (std::strcmp(argv[i], "-q") == 0 || std::strcmp(argv[i], "--quiet") == 0)
|
else if (std::strcmp(argv[i], "-q") == 0 || std::strcmp(argv[i], "--quiet") == 0)
|
||||||
_settings->quiet = true;
|
_settings->quiet = true;
|
||||||
|
|
||||||
// Append user-defined code to checked source code
|
|
||||||
else if (std::strncmp(argv[i], "--append=", 9) == 0) {
|
|
||||||
// This is deprecated and will be removed in 1.80
|
|
||||||
PrintMessage("cppcheck: '--append' is deprecated and will be removed in version 1.80. To supply additional information to cppcheck, use --library or --include.");
|
|
||||||
|
|
||||||
const std::string filename = 9 + argv[i];
|
|
||||||
if (!_settings->append(filename)) {
|
|
||||||
PrintMessage("cppcheck: Couldn't open the file: \"" + filename + "\".");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check configuration
|
// Check configuration
|
||||||
else if (std::strcmp(argv[i], "--check-config") == 0) {
|
else if (std::strcmp(argv[i], "--check-config") == 0) {
|
||||||
_settings->checkConfiguration = true;
|
_settings->checkConfiguration = true;
|
||||||
|
|
|
@ -272,7 +272,6 @@ unsigned int CppCheck::processFile(const std::string& filename, const std::strin
|
||||||
Timer t("Preprocessor::getcode", _settings.showtime, &S_timerResults);
|
Timer t("Preprocessor::getcode", _settings.showtime, &S_timerResults);
|
||||||
codeWithoutCfg = preprocessor.getcode(tokens1, cfg, files, true);
|
codeWithoutCfg = preprocessor.getcode(tokens1, cfg, files, true);
|
||||||
}
|
}
|
||||||
codeWithoutCfg += _settings.append();
|
|
||||||
|
|
||||||
if (_settings.preprocessOnly) {
|
if (_settings.preprocessOnly) {
|
||||||
if (codeWithoutCfg.compare(0,5,"#file") == 0)
|
if (codeWithoutCfg.compare(0,5,"#file") == 0)
|
||||||
|
|
|
@ -129,22 +129,3 @@ bool Settings::isEnabled(Severity::SeverityType severity) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::append(const std::string &filename)
|
|
||||||
{
|
|
||||||
std::ifstream fin(filename.c_str());
|
|
||||||
if (!fin.is_open()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
std::string line;
|
|
||||||
while (std::getline(fin, line)) {
|
|
||||||
_append += line + "\n";
|
|
||||||
}
|
|
||||||
Preprocessor::preprocessWhitespaces(_append);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string &Settings::append() const
|
|
||||||
{
|
|
||||||
return _append;
|
|
||||||
}
|
|
||||||
|
|
|
@ -56,9 +56,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** @brief Code to append in the checks */
|
|
||||||
std::string _append;
|
|
||||||
|
|
||||||
/** @brief enable extra checks by id */
|
/** @brief enable extra checks by id */
|
||||||
int _enabled;
|
int _enabled;
|
||||||
|
|
||||||
|
@ -161,12 +158,6 @@ public:
|
||||||
for finding include files inside source files. (-I) */
|
for finding include files inside source files. (-I) */
|
||||||
std::list<std::string> includePaths;
|
std::list<std::string> includePaths;
|
||||||
|
|
||||||
/** @brief assign append code (--append) */
|
|
||||||
bool append(const std::string &filename);
|
|
||||||
|
|
||||||
/** @brief get append code (--append) */
|
|
||||||
const std::string &append() const;
|
|
||||||
|
|
||||||
/** @brief Maximum number of configurations to check before bailing.
|
/** @brief Maximum number of configurations to check before bailing.
|
||||||
Default is 12. (--max-configs=N) */
|
Default is 12. (--max-configs=N) */
|
||||||
unsigned int maxConfigs;
|
unsigned int maxConfigs;
|
||||||
|
|
Loading…
Reference in New Issue