Compare commits
1 Commits
master
...
testing/ba
Author | SHA1 | Date |
---|---|---|
Martchus | 2dc5219adf |
|
@ -14,6 +14,9 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#ifdef DEBUG_BUILD
|
||||||
|
#include <fstream>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
@ -680,6 +683,15 @@ void ArgumentParser::readArgs(int argc, const char *const *argv)
|
||||||
bool completionMode = !strcmp(*++argv, "--bash-completion-for");
|
bool completionMode = !strcmp(*++argv, "--bash-completion-for");
|
||||||
unsigned int currentWordIndex;
|
unsigned int currentWordIndex;
|
||||||
if (completionMode) {
|
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
|
// the first argument after "--bash-completion-for" is the index of the current word
|
||||||
try {
|
try {
|
||||||
currentWordIndex = (--argc ? stringToNumber<unsigned int, string>(*(++argv)) : 0);
|
currentWordIndex = (--argc ? stringToNumber<unsigned int, string>(*(++argv)) : 0);
|
||||||
|
|
Loading…
Reference in New Issue