diff options
author | myltsev <myltsev@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | fc361854fd6ee8d747229b090f0b8018e260d1fb (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/getopt | |
parent | 9166d66c30c23c9e85a7c88185a068987148d23f (diff) | |
download | ydb-fc361854fd6ee8d747229b090f0b8018e260d1fb.tar.gz |
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opt.h | 14 | ||||
-rw-r--r-- | library/cpp/getopt/ut/last_getopt_ut.cpp | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h index f1ed8c7017..a8dd5adca9 100644 --- a/library/cpp/getopt/small/last_getopt_opt.h +++ b/library/cpp/getopt/small/last_getopt_opt.h @@ -637,11 +637,11 @@ namespace NLastGetopt { return DefaultValue("0").StoreResult(target, true); } - // Similar to store_true in Python's argparse - TOpt& StoreTrue(bool* target) { - return NoArgument().SetFlag(target); - } - + // Similar to store_true in Python's argparse + TOpt& StoreTrue(bool* target) { + return NoArgument().SetFlag(target); + } + template <typename TpVal, typename T, typename TpFunc> TOpt& StoreMappedResultT(T* target, const TpFunc& func) { return Handler1T<TpVal>(NPrivate::TStoreMappedResultFunctor<T, TpFunc, TpVal>(target, func)); @@ -675,13 +675,13 @@ namespace NLastGetopt { // Appends FromString<T>(arg) to *target for each argument template <typename T> TOpt& AppendTo(TVector<T>* target) { - return Handler1T<T>([target](auto&& value) { target->push_back(std::move(value)); }); + return Handler1T<T>([target](auto&& value) { target->push_back(std::move(value)); }); } // Appends FromString<T>(arg) to *target for each argument template <typename T> TOpt& InsertTo(THashSet<T>* target) { - return Handler1T<T>([target](auto&& value) { target->insert(std::move(value)); }); + return Handler1T<T>([target](auto&& value) { target->insert(std::move(value)); }); } // Emplaces TString arg to *target for each argument diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index cec948ecac..c99a1d053d 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -455,20 +455,20 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } Y_UNIT_TEST(TestSetFlag) { - bool a = false, b = true, c = false, d = true; + bool a = false, b = true, c = false, d = true; TOptsNoDefault opts; opts.AddLongOption('a', "alpha").NoArgument().SetFlag(&a); opts.AddLongOption('b', "beta").NoArgument().SetFlag(&b); - opts.AddCharOption('c').StoreTrue(&c); - opts.AddCharOption('d').StoreTrue(&d); + opts.AddCharOption('c').StoreTrue(&c); + opts.AddCharOption('d').StoreTrue(&d); - TOptsParseResultTestWrapper r(&opts, V({"cmd", "-a", "-c"})); + TOptsParseResultTestWrapper r(&opts, V({"cmd", "-a", "-c"})); UNIT_ASSERT(a); UNIT_ASSERT(!b); - UNIT_ASSERT(c); - UNIT_ASSERT(!d); + UNIT_ASSERT(c); + UNIT_ASSERT(!d); } Y_UNIT_TEST(TestDefaultValue) { |