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

Method Init

library/cpp/getopt/small/last_getopt_parse_result.cpp:183–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 void TOptsParseResult::Init(const TOpts* options, int argc, const char** argv) {
184 try {
185 Parser_.Reset(new TOptsParser(options, argc, argv));
186 while (Parser_->Next()) {
187 TOptParseResult& r = OptParseResult();
188 r.AddValue(Parser_->CurValOrOpt().data());
189 }
190
191 Y_ENSURE(options);
192 BuildTaggedFreeArgs(options);
193 const auto freeArgs = GetFreeArgs();
194 for (size_t i = 0; i < freeArgs.size(); ++i) {
195 if (i >= options->ArgBindings_.size()) {
196 break;
197 }
198
199 options->ArgBindings_[i](freeArgs[i]);
200 }
201
202 if (options->CheckUserTypos_) {
203 for (auto arg: TVector<TString>(argv, std::next(argv, argc))) {
204 FindUserTypos(arg, options);
205 }
206 }
207 } catch (...) {
208 HandleError();
209 }
210 }
211
212 void TOptsParseResult::HandleError() const {
213 Cerr << CurrentExceptionMessage() << Endl;

Callers

nothing calls this directly

Calls 8

FindUserTyposFunction · 0.85
CurValOrOptMethod · 0.80
nextFunction · 0.50
ResetMethod · 0.45
NextMethod · 0.45
AddValueMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected