16 #include "eckit/exception/Exceptions.h"
17 #include "eckit/utils/Translator.h"
25 : commandLineParsed_(false),
28 registeredOptionsWithArguments_(),
29 optionsWithArguments_(),
30 optionsNoArguments_(),
42 self.commandLineParsed_ =
true;
49 if (
this == &other)
return *
this;
57 self.commandLineParsed_ =
true;
71 ss <<
"Expected at least " <<
i <<
" command line parameters";
72 throw eckit::UserError(ss.str());
107 eckit::Translator<std::string, T> translator;
108 return translator(it->second);
113 for (
int i = 0;
i <
argc(); ++
i)
115 std::string s =
argv(
i);
116 if (s[0] !=
'-' || s.size() == 1)
119 eckit::Log::debug() <<
"CommandLineParser::parseCommandLine: parameter: " << s << std::endl;
126 eckit::Log::debug() <<
"CommandLineParser::parseCommandLine: option with argument: "
132 eckit::Log::debug() <<
"CommandLineParser::parseCommandLine: option with no argument: " << s << std::endl;
145 s <<
i->first <<
" " <<
i->second <<
" ";