diff options
| author | moskupols <[email protected]> | 2022-02-10 16:50:52 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:52 +0300 | 
| commit | 7a8bfeeee3a2a91c8b26e196d49efc264a0f9941 (patch) | |
| tree | 1b8e23cfad053b844f02054a0d30f8d1c355859f /library/cpp/getopt | |
| parent | dd6b55b11723e4bb5b0cf7bffc0e45f15e2e46d3 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt')
| -rw-r--r-- | library/cpp/getopt/small/last_getopt_opt.h | 12 | ||||
| -rw-r--r-- | library/cpp/getopt/ut/last_getopt_ut.cpp | 26 | 
2 files changed, 19 insertions, 19 deletions
| diff --git a/library/cpp/getopt/small/last_getopt_opt.h b/library/cpp/getopt/small/last_getopt_opt.h index a8dd5adca90..3272af30b22 100644 --- a/library/cpp/getopt/small/last_getopt_opt.h +++ b/library/cpp/getopt/small/last_getopt_opt.h @@ -684,12 +684,12 @@ namespace NLastGetopt {              return Handler1T<T>([target](auto&& value) { target->insert(std::move(value)); });          } -        // Emplaces TString arg to *target for each argument -        template <typename T> -        TOpt& EmplaceTo(TVector<T>* target) { -            return Handler1T<TString>([target](TString arg) { target->emplace_back(std::move(arg)); } ); -        } - +        // Emplaces TString arg to *target for each argument  +        template <typename T>  +        TOpt& EmplaceTo(TVector<T>* target) {  +            return Handler1T<TString>([target](TString arg) { target->emplace_back(std::move(arg)); } );  +        }  +           template <class Container>          TOpt& SplitHandler(Container* target, const char delim) {              return Handler(new NLastGetopt::TOptSplitHandler<Container>(target, delim)); diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index c99a1d053d1..bfb790b78cb 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -713,19 +713,19 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) {          UNIT_ASSERT_VALUES_EQUAL(19, ints.at(1));      } -    Y_UNIT_TEST(TestEmplaceTo) { -        TVector<std::tuple<TString>> richPaths; - -        TOptsNoDefault opts; -        opts.AddLongOption("path").EmplaceTo(&richPaths); - -        TOptsParseResultTestWrapper r(&opts, V({"cmd", "--path=<a=b>//cool", "--path=//nice"})); - -        UNIT_ASSERT_VALUES_EQUAL(size_t(2), richPaths.size()); -        UNIT_ASSERT_VALUES_EQUAL("<a=b>//cool", std::get<0>(richPaths.at(0))); -        UNIT_ASSERT_VALUES_EQUAL("//nice", std::get<0>(richPaths.at(1))); -    } - +    Y_UNIT_TEST(TestEmplaceTo) {  +        TVector<std::tuple<TString>> richPaths;  +  +        TOptsNoDefault opts;  +        opts.AddLongOption("path").EmplaceTo(&richPaths);  +  +        TOptsParseResultTestWrapper r(&opts, V({"cmd", "--path=<a=b>//cool", "--path=//nice"}));  +  +        UNIT_ASSERT_VALUES_EQUAL(size_t(2), richPaths.size());  +        UNIT_ASSERT_VALUES_EQUAL("<a=b>//cool", std::get<0>(richPaths.at(0)));  +        UNIT_ASSERT_VALUES_EQUAL("//nice", std::get<0>(richPaths.at(1)));  +    }  +       Y_UNIT_TEST(TestKVHandler) {          TStringBuilder keyvals; | 
