Skip to content

Commit

Permalink
Fix #986 (Move --all and --style to --enable)
Browse files Browse the repository at this point in the history
  • Loading branch information
aggro80 committed Nov 29, 2009
1 parent e6b5fe9 commit f1ae932
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/cppcheck.cpp
Expand Up @@ -178,6 +178,11 @@ void CppCheck::parseFromArgs(int argc, const char* const argv[])
if (pos != std::string::npos)
s.erase(pos, 1);
_settings.enableId += "," + s + ",";

if (_settings.enableId.find(",style,") != std::string::npos)
_settings._checkCodingStyle = true;
if (_settings.enableId.find(",possibleError,") != std::string::npos)
_settings._showAll = true;
}
}

Expand Down Expand Up @@ -357,8 +362,7 @@ void CppCheck::parseFromArgs(int argc, const char* const argv[])
"If path is given instead of filename, *.cpp, *.cxx, *.cc, *.c++ and *.c files\n"
"are checked recursively from given directory.\n\n"
"Options:\n"
" -a, --all Make the checking more sensitive. More bugs are\n"
" detected, but there are also more false positives\n"
" -a, --all deprecated, use --enable=possibleError\n"
" --append=file This allows you to provide information about\n"
" functions by providing an implementation for these.\n"
" --auto-dealloc file Suppress warnings about classes that have automatic\n"
Expand All @@ -371,6 +375,10 @@ void CppCheck::parseFromArgs(int argc, const char* const argv[])
" --enable=id Enable specific checks. The available ids are:\n"
" * exceptNew - exception safety when using new\n"
" * exceptRealloc - exception safety when reallocating\n"
" * possibleError - Make the checking more sensitive.\n"
" More bugs are detected, but there are also\n"
" more false positives\n"
" * style - Check coding style\n"
" * unusedFunctions - check for unused functions\n"
" Several ids can be given if you separate them with commas\n"
" --error-exitcode=[n] If errors are found, integer [n] is returned instead\n"
Expand All @@ -386,7 +394,7 @@ void CppCheck::parseFromArgs(int argc, const char* const argv[])
" paths are relative to source files, this is not needed\n"
" -j [jobs] Start [jobs] threads to do the checking simultaneously.\n"
" -q, --quiet Only print error messages\n"
" -s, --style Check coding style\n"
" -s, --style deprecated, use --enable=style\n"
" --suppressions file Suppress warnings listed in the file. Filename and line\n"
" are optional. The format of the single line in file is:\n"
" [error id]:[filename]:[line]\n"
Expand Down

0 comments on commit f1ae932

Please sign in to comment.