Change -w to -j to make it similar with make and scons.

This commit is contained in:
Reijo Tomperi 2009-02-22 18:38:10 +00:00
parent c50493e940
commit a7b0c30884
6 changed files with 19 additions and 19 deletions

View File

@ -110,7 +110,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
<arg choice="opt"><option>--style</option></arg>
<arg choice="opt"><option>--unused-functions</option></arg>
<arg choice="opt"><option>--verbose</option></arg>
<arg choice="opt"><option>-w[workers]</option></arg>
<arg choice="opt"><option>-j[jobs]</option></arg>
<arg choice="opt"><option>--xml</option></arg>
<arg choice="opt"><option>file or path</option></arg>
<arg choice="plain"><option>...</option></arg>
@ -188,9 +188,9 @@ files, this is not needed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-w [workers]</option></term>
<term><option>-j [jobs]</option></term>
<listitem>
<para>Start [workers] threads to do the checking work.</para>
<para>Start [jobs] threads to do the checking work.</para>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -147,35 +147,35 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[])
}
// Include paths
else if (strcmp(argv[i], "-w") == 0 ||
strncmp(argv[i], "-w", 2) == 0)
else if (strcmp(argv[i], "-j") == 0 ||
strncmp(argv[i], "-j", 2) == 0)
{
std::string numberString;
// "-w 3"
if (strcmp(argv[i], "-w") == 0)
// "-j 3"
if (strcmp(argv[i], "-j") == 0)
{
++i;
if (i >= argc)
return "cppcheck: argument to '-w' is missing\n";
return "cppcheck: argument to '-j' is missing\n";
numberString = argv[i];
}
// "-w3"
else if (strncmp(argv[i], "-w", 2) == 0)
// "-j3"
else if (strncmp(argv[i], "-j", 2) == 0)
{
numberString = argv[i];
numberString = numberString.substr(2);
}
std::istringstream iss(numberString);
if (!(iss >> _settings._workers))
return "cppcheck: argument to '-w' is not a number\n";
if (!(iss >> _settings._jobs))
return "cppcheck: argument to '-j' is not a number\n";
if (_settings._workers > 1000)
if (_settings._jobs > 1000)
{
return "cppcheck: argument for '-w' is allowed to be 1000 at max\n";
return "cppcheck: argument for '-j' is allowed to be 1000 at max\n";
}
}
@ -225,7 +225,7 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[])
" --unused-functions Check if there are unused functions\n"
" --vcl Suppress messages about memory leaks when using VCL classes\n"
" -v, --verbose More detailed error reports\n"
" -w [workers] Start [workers] threads to do the checking work.\n"
" -j [jobs] Start [jobs] threads to do the checking simultaneously.\n"
" --xml Write results in xml to error stream.\n"
"\n"
"Example usage:\n"

View File

@ -47,7 +47,7 @@ unsigned int CppCheckExecutor::check(int argc, const char* const argv[])
}
unsigned int returnValue = 0;
if (_settings._workers == 1)
if (_settings._jobs == 1)
{
// Single process
returnValue = cppCheck.check();

View File

@ -31,7 +31,7 @@ Settings::Settings()
_unusedFunctions = false;
_security = false;
_vcl = false;
_workers = 1;
_jobs = 1;
}
Settings::~Settings()

View File

@ -54,7 +54,7 @@ public:
/** How many processes/threads should do checking at the same
time. Default is 1. */
unsigned int _workers;
unsigned int _jobs;
};
#endif // SETTINGS_H

View File

@ -114,7 +114,7 @@ unsigned int ThreadExecutor::check()
for (unsigned int i = 0; i < _filenames.size(); i++)
{
// Keep only wanted amount of child processes running at a time.
if (childCount >= _settings._workers)
if (childCount >= _settings._jobs)
{
while (handleRead(result))
{