| 6 | |
| 7 | namespace NLastGetopt { |
| 8 | void TOptsParser::Init(const TOpts* opts, int argc, const char* argv[]) { |
| 9 | opts->Validate(); |
| 10 | |
| 11 | Opts_ = opts; |
| 12 | |
| 13 | if (argc < 1) |
| 14 | throw TUsageException() << "argv must have at least one argument"; |
| 15 | |
| 16 | Argc_ = argc; |
| 17 | Argv_ = argv; |
| 18 | |
| 19 | ProgramName_ = argv[0]; |
| 20 | |
| 21 | Pos_ = 1; |
| 22 | Sop_ = 0; |
| 23 | CurrentOpt_ = nullptr; |
| 24 | CurrentValue_ = nullptr; |
| 25 | GotMinusMinus_ = false; |
| 26 | Stopped_ = false; |
| 27 | OptsSeen_.clear(); |
| 28 | OptsDefault_.clear(); |
| 29 | } |
| 30 | |
| 31 | void TOptsParser::Init(const TOpts* opts, int argc, char* argv[]) { |
| 32 | Init(opts, argc, const_cast<const char**>(argv)); |
nothing calls this directly
no test coverage detected