diff --git a/application/argumentparser.cpp b/application/argumentparser.cpp index 85a242f..6561520 100644 --- a/application/argumentparser.cpp +++ b/application/argumentparser.cpp @@ -14,6 +14,9 @@ #include #include #include +#ifdef DEBUG_BUILD +#include +#endif using namespace std; using namespace std::placeholders; @@ -680,6 +683,15 @@ void ArgumentParser::readArgs(int argc, const char *const *argv) bool completionMode = !strcmp(*++argv, "--bash-completion-for"); unsigned int currentWordIndex; if (completionMode) { +#ifdef DEBUG_BUILD + { + fstream completionLog(argsToString("/tmp/", applicationName, "-bash-completion.log"), ios_base::out | ios_base::app); + for (const char *const *i = argv, *const *end = argv + argc; i != end; ++i) { + completionLog << '\"' << *i << '\"' << ' '; + } + completionLog << '\n'; + } +#endif // the first argument after "--bash-completion-for" is the index of the current word try { currentWordIndex = (--argc ? stringToNumber(*(++argv)) : 0);