diff options
author | amatanhead <amatanhead@yandex-team.ru> | 2022-02-10 16:50:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:04 +0300 |
commit | 8879605a63ac17539be5b3bd41b529791f4d4b02 (patch) | |
tree | 5739c7303cbe09d02b881e25bb294a4a173422a0 /library/cpp/getopt/small/last_getopt_parser.cpp | |
parent | 830fe7ae4073c2707f3f3138303ccc56052c0327 (diff) | |
download | ydb-8879605a63ac17539be5b3bd41b529791f4d4b02.tar.gz |
Restoring authorship annotation for <amatanhead@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt/small/last_getopt_parser.cpp')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_parser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp index 7668b12a03..10eebc3c45 100644 --- a/library/cpp/getopt/small/last_getopt_parser.cpp +++ b/library/cpp/getopt/small/last_getopt_parser.cpp @@ -11,7 +11,7 @@ namespace NLastGetopt { Opts_ = opts; if (argc < 1) - throw TUsageException() << "argv must have at least one argument"; + throw TUsageException() << "argv must have at least one argument"; Argc_ = argc; Argv_ = argv; @@ -66,11 +66,11 @@ namespace NLastGetopt { Y_ASSERT(!Stopped_); if (Opts_->FreeArgsMin_ == Opts_->FreeArgsMax_ && Argc_ - Pos_ != Opts_->FreeArgsMin_) - throw TUsageException() << "required exactly " << Opts_->FreeArgsMin_ << " free args"; + throw TUsageException() << "required exactly " << Opts_->FreeArgsMin_ << " free args"; else if (Argc_ - Pos_ < Opts_->FreeArgsMin_) - throw TUsageException() << "required at least " << Opts_->FreeArgsMin_ << " free args"; + throw TUsageException() << "required at least " << Opts_->FreeArgsMin_ << " free args"; else if (Argc_ - Pos_ > Opts_->FreeArgsMax_) - throw TUsageException() << "required at most " << Opts_->FreeArgsMax_ << " free args"; + throw TUsageException() << "required at most " << Opts_->FreeArgsMax_ << " free args"; return false; } @@ -83,7 +83,7 @@ namespace NLastGetopt { Y_ASSERT(EIO_NONE != IsOpt(arg)); if (!Opts_->AllowUnknownCharOptions_) - throw TUsageException() << "unknown option '" << EscapeC(arg[sop]) + throw TUsageException() << "unknown option '" << EscapeC(arg[sop]) << "' in '" << arg << "'"; TempCurrentOpt_.Reset(new TOpt); @@ -152,13 +152,13 @@ namespace NLastGetopt { } else if (Opts_->AllowUnknownLongOptions_) { return false; } else { - throw TUsageException() << "unknown option '" << optionName + throw TUsageException() << "unknown option '" << optionName << "' in '" << Argv_[pos] << "'"; } } if (arg.IsInited()) { if (option->GetHasArg() == NO_ARGUMENT) - throw TUsageException() << "option " << optionName << " must have no arg"; + throw TUsageException() << "option " << optionName << " must have no arg"; return Commit(option, arg, pos + 1, 0); } ++pos; @@ -175,7 +175,7 @@ namespace NLastGetopt { } if (pos == Argc_) { if (opt->GetHasArg() == REQUIRED_ARGUMENT) - throw TUsageException() << "option " << opt->ToShortString() << " must have arg"; + throw TUsageException() << "option " << opt->ToShortString() << " must have arg"; return Commit(opt, nullptr, pos, 0); } const TStringBuf arg(Argv_[pos]); |