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

Method get_option_no_throw

simcore/framework/src/cli/cli.hpp:6046–6062  ·  view source on GitHub ↗

Get an option by name (noexcept non-const version)

Source from the content-addressed store, hash-verified

6044
6045 /// Get an option by name (noexcept non-const version)
6046 Option *get_option_no_throw(std::string option_name) noexcept {
6047 for (Option_p &opt : options_) {
6048 if (opt->check_name(option_name)) {
6049 return opt.get();
6050 }
6051 }
6052 for (auto &subc : subcommands_) {
6053 // also check down into nameless subcommands
6054 if (subc->get_name().empty()) {
6055 auto opt = subc->get_option_no_throw(option_name);
6056 if (opt != nullptr) {
6057 return opt;
6058 }
6059 }
6060 }
6061 return nullptr;
6062 }
6063
6064 /// Get an option by name (noexcept const version)
6065 const Option *get_option_no_throw(std::string option_name) const noexcept {

Callers 3

needsMethod · 0.80
excludesMethod · 0.80
retire_optionFunction · 0.80

Calls 4

check_nameMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected