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

Method remove_option

simcore/framework/src/cli/cli.hpp:5448–5465  ·  view source on GitHub ↗

Removes an option from the App. Takes an option pointer. Returns true if found and removed.

Source from the content-addressed store, hash-verified

5446
5447 /// Removes an option from the App. Takes an option pointer. Returns true if found and removed.
5448 bool remove_option(Option *opt) {
5449 // Make sure no links exist
5450 for (Option_p &op : options_) {
5451 op->remove_needs(opt);
5452 op->remove_excludes(opt);
5453 }
5454
5455 if (help_ptr_ == opt) help_ptr_ = nullptr;
5456 if (help_all_ptr_ == opt) help_all_ptr_ = nullptr;
5457
5458 auto iterator =
5459 std::find_if(std::begin(options_), std::end(options_), [opt](const Option_p &v) { return v.get() == opt; });
5460 if (iterator != std::end(options_)) {
5461 options_.erase(iterator);
5462 return true;
5463 }
5464 return false;
5465 }
5466
5467 /// creates an option group as part of the given app
5468 template <typename T = Option_group>

Callers 1

retire_optionFunction · 0.80

Calls 6

beginFunction · 0.85
endFunction · 0.85
remove_needsMethod · 0.45
remove_excludesMethod · 0.45
getMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected