From 84e8d456c4f587c0ad1a97baa9aeff26c94d7daf Mon Sep 17 00:00:00 2001 From: pouillot Date: Sun, 4 Dec 2011 09:52:16 +0000 Subject: [PATCH] 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 --- src/libs/tgf/application.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libs/tgf/application.cpp b/src/libs/tgf/application.cpp index cca84e838..d5bb6f6b7 100644 --- a/src/libs/tgf/application.cpp +++ b/src/libs/tgf/application.cpp @@ -246,10 +246,10 @@ bool GfApplication::parseOptions() GfInitInstallDir(_lstArgs.front().c_str()); // Parse args, looking for registered options. + GfLogInfo("Parsing command line args (%d)\n", _lstArgs.size() - 1); std::list::const_iterator itArg = _lstArgs.begin(); for (itArg++; itArg != _lstArgs.end(); itArg++) { - GfLogInfo("* [%s]\n", itArg->c_str()); bool bArgEaten = false; 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. if (itOpt->bHasValue) { + const std::string strFlag(*itArg); itArg++; if (itArg != _lstArgs.end() // Some extra arg available ... && itArg->find('-') != 0) // ... and not an option flag : { 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 { @@ -276,6 +279,11 @@ bool GfApplication::parseOptions() 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. itOpt->bFound = true; @@ -287,7 +295,10 @@ bool GfApplication::parseOptions() // Save any ignored arg in the "remaining" list. if (!bArgEaten) + { _vecRemArgs.push_back(*itArg); + GfLogInfo(" %s : not a registered option\n", itArg->c_str()); + } } // Interpret the detected command line options.