cleanup more java/c# code. Thanks amai for telling me about this.
This commit is contained in:
parent
2f069f550f
commit
1e024a9abc
|
@ -143,10 +143,6 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
_settings->enforcedLang = Settings::C;
|
_settings->enforcedLang = Settings::C;
|
||||||
else if (str == "c++")
|
else if (str == "c++")
|
||||||
_settings->enforcedLang = Settings::CPP;
|
_settings->enforcedLang = Settings::CPP;
|
||||||
else if (str == "c#")
|
|
||||||
_settings->enforcedLang = Settings::CSharp;
|
|
||||||
else if (str == "java")
|
|
||||||
_settings->enforcedLang = Settings::Java;
|
|
||||||
else {
|
else {
|
||||||
PrintMessage("cppcheck: Unknown language '" + str + "' enforced.");
|
PrintMessage("cppcheck: Unknown language '" + str + "' enforced.");
|
||||||
return false;
|
return false;
|
||||||
|
@ -791,7 +787,7 @@ void CmdLineParser::PrintHelp()
|
||||||
" -j <jobs> Start [jobs] threads to do the checking simultaneously.\n"
|
" -j <jobs> Start [jobs] threads to do the checking simultaneously.\n"
|
||||||
" --language=<language>, -x <language>\n"
|
" --language=<language>, -x <language>\n"
|
||||||
" Forces cppcheck to check all files as the given\n"
|
" Forces cppcheck to check all files as the given\n"
|
||||||
" language. Valid values are: c, c++, java, c#\n"
|
" language. Valid values are: c, c++\n"
|
||||||
" --max-configs=<limit>\n"
|
" --max-configs=<limit>\n"
|
||||||
" Maximum number of configurations to check in a file\n"
|
" Maximum number of configurations to check in a file\n"
|
||||||
" before skipping it. Default is '12'. If used together\n"
|
" before skipping it. Default is '12'. If used together\n"
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
std::string addEnabled(const std::string &str);
|
std::string addEnabled(const std::string &str);
|
||||||
|
|
||||||
enum Language {
|
enum Language {
|
||||||
None, C, CPP, CSharp, Java
|
None, C, CPP
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @brief Name of the language that is enforced. Empty per default. */
|
/** @brief Name of the language that is enforced. Empty per default. */
|
||||||
|
|
|
@ -410,20 +410,6 @@ private:
|
||||||
ASSERT(parser.ParseFromArgs(3, argv));
|
ASSERT(parser.ParseFromArgs(3, argv));
|
||||||
ASSERT_EQUALS(Settings::C, settings.enforcedLang);
|
ASSERT_EQUALS(Settings::C, settings.enforcedLang);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const char *argv[] = {"cppcheck", "--language=c#", "file.cpp"};
|
|
||||||
Settings settings;
|
|
||||||
CmdLineParser parser(&settings);
|
|
||||||
ASSERT(parser.ParseFromArgs(3, argv));
|
|
||||||
ASSERT_EQUALS(Settings::CSharp, settings.enforcedLang);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
const char *argv[] = {"cppcheck", "--language=java", "file.cpp"};
|
|
||||||
Settings settings;
|
|
||||||
CmdLineParser parser(&settings);
|
|
||||||
ASSERT(parser.ParseFromArgs(3, argv));
|
|
||||||
ASSERT_EQUALS(Settings::Java, settings.enforcedLang);
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
const char *argv[] = {"cppcheck", "--language=unknwonLanguage", "file.cpp"};
|
const char *argv[] = {"cppcheck", "--language=unknwonLanguage", "file.cpp"};
|
||||||
Settings settings;
|
Settings settings;
|
||||||
|
|
Loading…
Reference in New Issue