diff options
author | swarmer <swarmer@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
commit | 317da38588b7898a99fd9168571408123350012b (patch) | |
tree | 25eebc31526019ad39a6c1b13f492963d97ba439 /library/cpp/getopt | |
parent | 3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff) | |
download | ydb-317da38588b7898a99fd9168571408123350012b.tar.gz |
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r-- | library/cpp/getopt/small/last_getopt.h | 2 | ||||
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opt.h | 12 | ||||
-rw-r--r-- | library/cpp/getopt/ut/last_getopt_ut.cpp | 22 |
3 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/getopt/small/last_getopt.h b/library/cpp/getopt/small/last_getopt.h index 07687bc914..5314861064 100644 --- a/library/cpp/getopt/small/last_getopt.h +++ b/library/cpp/getopt/small/last_getopt.h @@ -9,7 +9,7 @@ /// see some documentation in /// https://wiki.yandex-team.ru/development/poisk/arcadia/util/lastgetopt/ -/// https://wiki.yandex-team.ru/development/poisk/arcadia/library/getopt/ +/// https://wiki.yandex-team.ru/development/poisk/arcadia/library/getopt/ /// see examples in library/cpp/getopt/last_getopt_demo //TODO: in most cases this include is unnecessary, but needed THandlerFunctor1<TpFunc, TpArg>::HandleOpt diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h index a8dd5adca9..f4d7c2cbad 100644 --- a/library/cpp/getopt/small/last_getopt_opt.h +++ b/library/cpp/getopt/small/last_getopt_opt.h @@ -604,12 +604,12 @@ namespace NLastGetopt { return StoreResultT<T>(target); } - // Uses TMaybe<T> to store FromString<T>(arg) - template <typename T> - TOpt& StoreResult(TMaybe<T>* target) { - return StoreResultT<T>(target); - } - + // Uses TMaybe<T> to store FromString<T>(arg) + template <typename T> + TOpt& StoreResult(TMaybe<T>* target) { + return StoreResultT<T>(target); + } + template <typename TpVal, typename T, typename TpDef> TOpt& StoreResultT(T* target, const TpDef& def) { return Handler1T<TpVal>(def, NPrivate::TStoreResultFunctor<T, TpVal>(target)); diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index c99a1d053d..b17fc90cd0 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -419,21 +419,21 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { TOptsNoDefault opts; TString data; int number; - TMaybe<TString> optionalString0, optionalString1; - TMaybe<int> optionalNumber0, optionalNumber1; + TMaybe<TString> optionalString0, optionalString1; + TMaybe<int> optionalNumber0, optionalNumber1; opts.AddLongOption('d', "data").StoreResult(&data); opts.AddLongOption('n', "number").StoreResult(&number); - opts.AddLongOption("optional-string-0").StoreResult(&optionalString0); - opts.AddLongOption("optional-number-0").StoreResult(&optionalNumber0); - opts.AddLongOption("optional-string-1").StoreResult(&optionalString1); - opts.AddLongOption("optional-number-1").StoreResult(&optionalNumber1); - TOptsParseResultTestWrapper r(&opts, V({"cmd", "--data=jjhh", "-n", "11", "--optional-number-1=8", "--optional-string-1=os1"})); + opts.AddLongOption("optional-string-0").StoreResult(&optionalString0); + opts.AddLongOption("optional-number-0").StoreResult(&optionalNumber0); + opts.AddLongOption("optional-string-1").StoreResult(&optionalString1); + opts.AddLongOption("optional-number-1").StoreResult(&optionalNumber1); + TOptsParseResultTestWrapper r(&opts, V({"cmd", "--data=jjhh", "-n", "11", "--optional-number-1=8", "--optional-string-1=os1"})); UNIT_ASSERT_VALUES_EQUAL("jjhh", data); UNIT_ASSERT_VALUES_EQUAL(11, number); - UNIT_ASSERT(!optionalString0.Defined()); - UNIT_ASSERT(!optionalNumber0.Defined()); - UNIT_ASSERT_VALUES_EQUAL(*optionalString1, "os1"); - UNIT_ASSERT_VALUES_EQUAL(*optionalNumber1, 8); + UNIT_ASSERT(!optionalString0.Defined()); + UNIT_ASSERT(!optionalNumber0.Defined()); + UNIT_ASSERT_VALUES_EQUAL(*optionalString1, "os1"); + UNIT_ASSERT_VALUES_EQUAL(*optionalNumber1, 8); } Y_UNIT_TEST(TestStoreValue) { |