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

Function mode_dump_options

catboost/app/mode_dump_options.cpp:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25int mode_dump_options(int argc, const char* argv[]) {
26 auto parser = NLastGetopt::TOpts();
27 TString snapshotPath;
28 parser
29 .AddLongOption("input", "path to snapshot file")
30 .RequiredArgument("STRING")
31 .StoreResult(&snapshotPath);
32 TString optionsPath;
33 parser
34 .AddLongOption("output", "path to options file; omit to output to stdout")
35 .OptionalArgument("STRING")
36 .StoreResult(&optionsPath);
37 parser.SetFreeArgsMax(0);
38 NLastGetopt::TOptsParseResult parserResult{&parser, argc, argv};
39 const auto options = ToString(GetOptions(snapshotPath));
40 if (optionsPath.empty()) {
41 Cout << options;
42 } else {
43 TFileOutput optionsFile(optionsPath);
44 optionsFile << options;
45 }
46 return 0;
47}

Callers

nothing calls this directly

Calls 5

GetOptionsFunction · 0.85
SetFreeArgsMaxMethod · 0.80
TOptsClass · 0.50
ToStringFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected