| 103 | } |
| 104 | |
| 105 | int main(int argc, char** argv) { |
| 106 | if (argc < 4) { |
| 107 | Cerr << "usage: " << argv[0] << " outfile [?--use-sections] [infile path]+ [- key=value]+" << Endl; |
| 108 | return 1; |
| 109 | } |
| 110 | |
| 111 | TFixedBufferFileOutput out(argv[1]); |
| 112 | bool useSections = false; |
| 113 | if (TStringBuf(argv[2]) == "--use-sections") { |
| 114 | useSections = true; |
| 115 | argv += 3; |
| 116 | } else { |
| 117 | argv += 2; |
| 118 | } |
| 119 | |
| 120 | EmitHeader(out, useSections); |
| 121 | |
| 122 | while (*argv) { |
| 123 | if ("-"sv == *argv) { |
| 124 | TVector<TString> items = StringSplitter(TString(*(argv + 1))).Split('=').Limit(2).ToList<TString>(); |
| 125 | GenOne(TString(items[1]), TString(items[0]), out, false /*isFile*/, useSections); |
| 126 | } else { |
| 127 | const char* key = *(argv + 1); |
| 128 | if (*key == '-') { |
| 129 | ++key; |
| 130 | } |
| 131 | TString data = useSections ? *argv : TUnbufferedFileInput(*argv).ReadAll(); |
| 132 | GenOne(data, key, out, true /*isFile*/, useSections); |
| 133 | } |
| 134 | argv += 2; |
| 135 | } |
| 136 | } |
nothing calls this directly
no test coverage detected