Definition at line 695 of file cxxopts.h.
void cxxopts::ParseResult::parse |
( |
int & |
argc, |
|
|
char **& |
argv |
|
) |
| |
|
inlineprivate |
Definition at line 1078 of file cxxopts.h.
References dir2webdir::argc, GCPpyPlots::argv, checked_parse_arg(), consume_positional(), createIOVlist::detail, mps_fire::i, m_allow_unrecognised, m_options, m_results, mergeVDriftHistosByStation::name, das-up-to-nevents::opt, parse_default(), parse_option(), mps_fire::result, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by ParseResult().
1083 bool consume_remaining =
false;
1085 while (current !=
argc) {
1086 if (strcmp(
argv[current],
"--") == 0) {
1087 consume_remaining =
true;
1092 std::match_results<const char*>
result;
1093 std::regex_match(
argv[current],
result, option_matcher);
1099 if (
argv[current][0] ==
'-' &&
argv[current][1] !=
'\0') {
1100 throw Option_syntax_exception(
argv[current]);
1113 if (
result[4].length() != 0) {
1116 for (std::size_t
i = 0;
i !=
s.size(); ++
i) {
1125 throw Option_not_exists_exception(
name);
1129 auto value = iter->second;
1131 if (
i + 1 ==
s.size()) {
1134 }
else if (
value->value().has_implicit()) {
1138 throw Option_requires_argument_exception(
name);
1141 }
else if (
result[1].length() != 0) {
1155 throw Option_not_exists_exception(
name);
1159 auto opt = iter->second;
1162 if (
result[2].length() != 0) {
1182 if (!store.count() &&
value.has_default()) {
1187 if (consume_remaining) {
1188 while (current <
argc) {
1196 while (current !=
argc) {
void checked_parse_arg(int argc, char *argv[], int ¤t, std::shared_ptr< OptionDetails > value, const std::string &name)
bool consume_positional(std::string a)
void parse_default(std::shared_ptr< OptionDetails > details)
std::unordered_map< std::shared_ptr< OptionDetails >, OptionValue > m_results
bool m_allow_unrecognised
const std::shared_ptr< std::unordered_map< std::string, std::shared_ptr< OptionDetails > > > m_options
void parse_option(std::shared_ptr< OptionDetails > value, const std::string &name, const std::string &arg="")