diff options
author | yuraaka <yuraaka@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
commit | 4230543261d7a38ef4dc14785ae0d45f2da43704 (patch) | |
tree | 7d5099e41a66d7501887488432100e3cfc69ea72 /library/cpp/getopt/small/last_getopt_opts.h | |
parent | 8cac63f90980b825f78cbd01f45b396297047c2c (diff) | |
download | ydb-4230543261d7a38ef4dc14785ae0d45f2da43704.tar.gz |
Restoring authorship annotation for <yuraaka@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt/small/last_getopt_opts.h')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opts.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/getopt/small/last_getopt_opts.h b/library/cpp/getopt/small/last_getopt_opts.h index 825b99c871..1361ad6731 100644 --- a/library/cpp/getopt/small/last_getopt_opts.h +++ b/library/cpp/getopt/small/last_getopt_opts.h @@ -43,7 +43,7 @@ namespace NLastGetopt { typedef TVector<TSimpleSharedPtr<TOpt>> TOptsVector; TOptsVector Opts_; // infomation about named (short and long) options - TVector<std::function<void(TStringBuf)>> ArgBindings_; + TVector<std::function<void(TStringBuf)>> ArgBindings_; EArgPermutation ArgPermutation_ = DEFAULT_ARG_PERMUTATION; // determines how to parse positions of named and free options. See information below. bool AllowSingleDashForLong_ = false; // @@ -245,22 +245,22 @@ namespace NLastGetopt { TOpt& AddOption(const TOpt& option); /** - * Creates new free argument handling - * @param name name of free arg to show in help - * @param target variable address to store parsing result into - * @param help help string to show in help - */ - template <typename T> - void AddFreeArgBinding(const TString& name, T& target, const TString& help = "") { - ArgBindings_.emplace_back([&target](TStringBuf value) { - target = FromString<T>(value); - }); - - FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); - SetFreeArgTitle(ArgBindings_.size() - 1, name, help); - } - - /** + * Creates new free argument handling + * @param name name of free arg to show in help + * @param target variable address to store parsing result into + * @param help help string to show in help + */ + template <typename T> + void AddFreeArgBinding(const TString& name, T& target, const TString& help = "") { + ArgBindings_.emplace_back([&target](TStringBuf value) { + target = FromString<T>(value); + }); + + FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); + SetFreeArgTitle(ArgBindings_.size() - 1, name, help); + } + + /** * Creates options list from string as in getopt(3) * * @param optstring source @@ -460,11 +460,11 @@ namespace NLastGetopt { /** * Set maximal number of free args * - * @param max new value + * @param max new value */ void SetFreeArgsMax(size_t max) { FreeArgsMax_ = ui32(max); - FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); + FreeArgsMax_ = Max<ui32>(FreeArgsMax_, ArgBindings_.size()); } /** |