aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt
diff options
context:
space:
mode:
authormyltsev <myltsev@yandex-team.ru>2022-02-10 16:46:03 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:03 +0300
commit9166d66c30c23c9e85a7c88185a068987148d23f (patch)
tree421bdcec5755d9e441c485560aab5ab8d74c7475 /library/cpp/getopt
parent8d3a5ed3a188a34167eaee54f1691ce5c9edf2f3 (diff)
downloadydb-9166d66c30c23c9e85a7c88185a068987148d23f.tar.gz
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r--library/cpp/getopt/small/last_getopt_opt.h14
-rw-r--r--library/cpp/getopt/ut/last_getopt_ut.cpp12
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 a8dd5adca9..f1ed8c7017 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 c99a1d053d..cec948ecac 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) {