MCPcopy Create free account
hub / github.com/catboost/catboost / MutuallyExclusiveHandler

Function MutuallyExclusiveHandler

library/cpp/getopt/small/last_getopt_opts.cpp:237–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235
236 namespace {
237 auto MutuallyExclusiveHandler(const TOpt* cur, const TOpt* other) {
238 return [cur, other](const TOptsParser* p) {
239 if (p->Seen(other)) {
240 throw TUsageException()
241 << "option " << cur->ToShortString()
242 << " can't appear together with option " << other->ToShortString();
243 }
244 };
245 }
246 }
247
248 void TOpts::MutuallyExclusiveOpt(TOpt& opt1, TOpt& opt2) {

Callers 1

MutuallyExclusiveOptMethod · 0.85

Calls 3

TUsageExceptionClass · 0.85
SeenMethod · 0.80
ToShortStringMethod · 0.80

Tested by

no test coverage detected