| 103 | } |
| 104 | |
| 105 | int dump(int argc, const char* argv[]) { |
| 106 | TCommonMetaInfoParams params; |
| 107 | NCB::EInfoDumpFormat dumpFormat; |
| 108 | auto parser = NLastGetopt::TOpts(); |
| 109 | parser.AddHelpOption(); |
| 110 | params.BindParser(parser); |
| 111 | parser.AddLongOption("dump-format", "One of 'Plain', 'JSON'") |
| 112 | .DefaultValue("Plain") |
| 113 | .StoreResult(&dumpFormat); |
| 114 | parser.SetFreeArgsMax(0); |
| 115 | NLastGetopt::TOptsParseResult parserResult{&parser, argc, argv}; |
| 116 | params.LoadModel(); |
| 117 | if (NCB::EInfoDumpFormat::Plain == dumpFormat) { |
| 118 | for (const auto& keyValue : params.Model.ModelInfo) { |
| 119 | Cout << keyValue.first << "\t" << keyValue.second << Endl; |
| 120 | } |
| 121 | } else if (NCB::EInfoDumpFormat::JSON == dumpFormat) { |
| 122 | NJson::TJsonValue value; |
| 123 | for (const auto& keyValue : params.Model.ModelInfo) { |
| 124 | value[keyValue.first] = keyValue.second; |
| 125 | } |
| 126 | Cout << value.GetStringRobust() << Endl; |
| 127 | } |
| 128 | return 0; |
| 129 | } |
| 130 | |
| 131 | int dump_feature_names(int argc, const char* argv[]) { |
| 132 | TCommonMetaInfoParams params; |
nothing calls this directly
no test coverage detected