| 23 | } |
| 24 | |
| 25 | int 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 | } |
nothing calls this directly
no test coverage detected