MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / _recognize

Method _recognize

simcore/framework/src/cli/cli.hpp:6403–6421  ·  view source on GitHub ↗

Selects a Classifier enum based on the type of the current argument

Source from the content-addressed store, hash-verified

6401
6402 /// Selects a Classifier enum based on the type of the current argument
6403 detail::Classifier _recognize(const std::string &current, bool ignore_used_subcommands = true) const {
6404 std::string dummy1, dummy2;
6405
6406 if (current == "--") return detail::Classifier::POSITIONAL_MARK;
6407 if (_valid_subcommand(current, ignore_used_subcommands)) return detail::Classifier::SUBCOMMAND;
6408 if (detail::split_long(current, dummy1, dummy2)) return detail::Classifier::LONG;
6409 if (detail::split_short(current, dummy1, dummy2)) {
6410 if (dummy1[0] >= '0' && dummy1[0] <= '9') {
6411 if (get_option_no_throw(std::string{'-', dummy1[0]}) == nullptr) {
6412 return detail::Classifier::NONE;
6413 }
6414 }
6415 return detail::Classifier::SHORT;
6416 }
6417 if ((allow_windows_style_options_) && (detail::split_windows_style(current, dummy1, dummy2)))
6418 return detail::Classifier::WINDOWS;
6419 if ((current == "++") && !name_.empty() && parent_ != nullptr) return detail::Classifier::SUBCOMMAND_TERMINATOR;
6420 return detail::Classifier::NONE;
6421 }
6422
6423 // The parse function is now broken into several parts, and part of process
6424

Callers

nothing calls this directly

Calls 4

split_longFunction · 0.85
split_shortFunction · 0.85
split_windows_styleFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected