Re #377 Added traces about the command line options (registered or not)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4257 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: a4c16bc89117f8643e58517554bde416256900d2 Former-commit-id: c5d0f724464974236723aea5f686d1d0632e7269
This commit is contained in:
parent
31827fe517
commit
84e8d456c4
1 changed files with 12 additions and 1 deletions
|
@ -246,10 +246,10 @@ bool GfApplication::parseOptions()
|
||||||
GfInitInstallDir(_lstArgs.front().c_str());
|
GfInitInstallDir(_lstArgs.front().c_str());
|
||||||
|
|
||||||
// Parse args, looking for registered options.
|
// Parse args, looking for registered options.
|
||||||
|
GfLogInfo("Parsing command line args (%d)\n", _lstArgs.size() - 1);
|
||||||
std::list<std::string>::const_iterator itArg = _lstArgs.begin();
|
std::list<std::string>::const_iterator itArg = _lstArgs.begin();
|
||||||
for (itArg++; itArg != _lstArgs.end(); itArg++)
|
for (itArg++; itArg != _lstArgs.end(); itArg++)
|
||||||
{
|
{
|
||||||
GfLogInfo("* [%s]\n", itArg->c_str());
|
|
||||||
bool bArgEaten = false;
|
bool bArgEaten = false;
|
||||||
if (itArg->find('-') == 0)
|
if (itArg->find('-') == 0)
|
||||||
{
|
{
|
||||||
|
@ -263,11 +263,14 @@ bool GfApplication::parseOptions()
|
||||||
// We've got a registered option flag : check if there's a value arg or not.
|
// We've got a registered option flag : check if there's a value arg or not.
|
||||||
if (itOpt->bHasValue)
|
if (itOpt->bHasValue)
|
||||||
{
|
{
|
||||||
|
const std::string strFlag(*itArg);
|
||||||
itArg++;
|
itArg++;
|
||||||
if (itArg != _lstArgs.end() // Some extra arg available ...
|
if (itArg != _lstArgs.end() // Some extra arg available ...
|
||||||
&& itArg->find('-') != 0) // ... and not an option flag :
|
&& itArg->find('-') != 0) // ... and not an option flag :
|
||||||
{
|
{
|
||||||
itOpt->strValue = *itArg; // We've got the value.
|
itOpt->strValue = *itArg; // We've got the value.
|
||||||
|
GfLogInfo(" %s %s : option '%s'\n", strFlag.c_str(),
|
||||||
|
itArg->c_str(), itOpt->strLongName.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -276,6 +279,11 @@ bool GfApplication::parseOptions()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GfLogInfo(" %s : option '%s'\n",
|
||||||
|
itArg->c_str(), itOpt->strLongName.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// Value or not, we've got an option, and we eat the arg(s) : done.
|
// Value or not, we've got an option, and we eat the arg(s) : done.
|
||||||
itOpt->bFound = true;
|
itOpt->bFound = true;
|
||||||
|
@ -287,7 +295,10 @@ bool GfApplication::parseOptions()
|
||||||
|
|
||||||
// Save any ignored arg in the "remaining" list.
|
// Save any ignored arg in the "remaining" list.
|
||||||
if (!bArgEaten)
|
if (!bArgEaten)
|
||||||
|
{
|
||||||
_vecRemArgs.push_back(*itArg);
|
_vecRemArgs.push_back(*itArg);
|
||||||
|
GfLogInfo(" %s : not a registered option\n", itArg->c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interpret the detected command line options.
|
// Interpret the detected command line options.
|
||||||
|
|
Loading…
Reference in a new issue