diff options
author | tldr <tldr@yandex-team.ru> | 2022-02-10 16:50:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:18 +0300 |
commit | 42d219fbd63ee173b0cb7db1b26a3ec615f0bb71 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/getopt | |
parent | fb217752f4b5a81abe9df05e38c5a71d080fc2a8 (diff) | |
download | ydb-42d219fbd63ee173b0cb7db1b26a3ec615f0bb71.tar.gz |
Restoring authorship annotation for <tldr@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r-- | library/cpp/getopt/small/completion_generator.cpp | 4 | ||||
-rw-r--r-- | library/cpp/getopt/small/modchooser.cpp | 32 | ||||
-rw-r--r-- | library/cpp/getopt/small/modchooser.h | 12 |
3 files changed, 24 insertions, 24 deletions
diff --git a/library/cpp/getopt/small/completion_generator.cpp b/library/cpp/getopt/small/completion_generator.cpp index 3e8a5302b47..ac41988217e 100644 --- a/library/cpp/getopt/small/completion_generator.cpp +++ b/library/cpp/getopt/small/completion_generator.cpp @@ -453,7 +453,7 @@ namespace NLastGetopt { auto& line = L << "COMPREPLY+=( $(compgen -W '"; TStringBuf sep = ""; for (auto& mode : modes) { - if (!mode->Hidden && !mode->NoCompletion) { + if (!mode->Hidden && !mode->NoCompletion) { line << sep << B(mode->Name); sep = " "; } @@ -470,7 +470,7 @@ namespace NLastGetopt { I; for (auto& mode : modes) { - if (mode->Name.empty() || mode->Hidden || mode->NoCompletion) { + if (mode->Name.empty() || mode->Hidden || mode->NoCompletion) { continue; } diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 3e37a768e1e..2fa5cfd0703 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -60,12 +60,12 @@ private: TMainClassV* Main; }; -TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion) +TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion) : Name(name) , Main(main) , Description(descr) , Hidden(hidden) - , NoCompletion(noCompletion) + , NoCompletion(noCompletion) { } @@ -80,25 +80,25 @@ TModChooser::TModChooser() TModChooser::~TModChooser() = default; -void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) { - AddMode(mode, TMainFunctionPtr(func), description, hidden, noCompletion); +void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) { + AddMode(mode, TMainFunctionPtr(func), description, hidden, noCompletion); } -void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtrV func, const TString& description, bool hidden, bool noCompletion) { - AddMode(mode, TMainFunctionPtrV(func), description, hidden, noCompletion); +void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtrV func, const TString& description, bool hidden, bool noCompletion) { + AddMode(mode, TMainFunctionPtrV(func), description, hidden, noCompletion); } -void TModChooser::AddMode(const TString& mode, const TMainFunctionPtr func, const TString& description, bool hidden, bool noCompletion) { +void TModChooser::AddMode(const TString& mode, const TMainFunctionPtr func, const TString& description, bool hidden, bool noCompletion) { Wrappers.push_back(MakeHolder<PtrWrapper>(func)); - AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); + AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); } -void TModChooser::AddMode(const TString& mode, const TMainFunctionPtrV func, const TString& description, bool hidden, bool noCompletion) { +void TModChooser::AddMode(const TString& mode, const TMainFunctionPtrV func, const TString& description, bool hidden, bool noCompletion) { Wrappers.push_back(MakeHolder<PtrvWrapper>(func)); - AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); + AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); } -void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden, bool noCompletion) { +void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden, bool noCompletion) { if (Modes.FindPtr(mode)) { ythrow yexception() << "TMode '" << mode << "' already exists in TModChooser."; } @@ -106,12 +106,12 @@ void TModChooser::AddMode(const TString& mode, TMainClass* func, const TString& Modes[mode] = UnsortedModes.emplace_back(MakeHolder<TMode>(mode, func, description, hidden, noCompletion)).Get(); } -void TModChooser::AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden, bool noCompletion) { +void TModChooser::AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden, bool noCompletion) { Wrappers.push_back(MakeHolder<ClassWrapper>(func)); - AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); + AddMode(mode, Wrappers.back().Get(), description, hidden, noCompletion); } -void TModChooser::AddGroupModeDescription(const TString& description, bool hidden, bool noCompletion) { +void TModChooser::AddGroupModeDescription(const TString& description, bool hidden, bool noCompletion) { UnsortedModes.push_back(MakeHolder<TMode>(TString(), nullptr, description.data(), hidden, noCompletion)); } @@ -156,10 +156,10 @@ void TModChooser::DisableSvnRevisionOption() { SvnRevisionOptionDisabled = true; } -void TModChooser::AddCompletions(TString progName, const TString& name, bool hidden, bool noCompletion) { +void TModChooser::AddCompletions(TString progName, const TString& name, bool hidden, bool noCompletion) { if (CompletionsGenerator == nullptr) { CompletionsGenerator = NLastGetopt::MakeCompletionMod(this, std::move(progName), name); - AddMode(name, CompletionsGenerator.Get(), "generate autocompletion files", hidden, noCompletion); + AddMode(name, CompletionsGenerator.Get(), "generate autocompletion files", hidden, noCompletion); } } diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index 2b9cf2246bd..0a8de6d50b5 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -51,11 +51,11 @@ public: void AddMode(const TString& mode, TMainFunctionRawPtrV func, const TString& description, bool hidden = false, bool noCompletion = false); void AddMode(const TString& mode, TMainFunctionPtr func, const TString& description, bool hidden = false, bool noCompletion = false); void AddMode(const TString& mode, TMainFunctionPtrV func, const TString& description, bool hidden = false, bool noCompletion = false); - void AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden = false, bool noCompletion = false); - void AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden = false, bool noCompletion = false); + void AddMode(const TString& mode, TMainClass* func, const TString& description, bool hidden = false, bool noCompletion = false); + void AddMode(const TString& mode, TMainClassV* func, const TString& description, bool hidden = false, bool noCompletion = false); //! Hidden groups won't be displayed in 'help' block - void AddGroupModeDescription(const TString& description, bool hidden = false, bool noCompletion = false); + void AddGroupModeDescription(const TString& description, bool hidden = false, bool noCompletion = false); //! Set default mode (if not specified explicitly) void SetDefaultMode(const TString& mode); @@ -82,7 +82,7 @@ public: void DisableSvnRevisionOption(); - void AddCompletions(TString progName, const TString& name = "completion", bool hidden = false, bool noCompletion = false); + void AddCompletions(TString progName, const TString& name = "completion", bool hidden = false, bool noCompletion = false); /*! Run appropriate mode. * @@ -107,7 +107,7 @@ public: TMainClass* Main; TString Description; bool Hidden; - bool NoCompletion; + bool NoCompletion; TVector<TString> Aliases; TMode() @@ -115,7 +115,7 @@ public: { } - TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion); + TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion); // Full name includes primary name and aliases. Also, will add ANSI colors. size_t CalculateFullNameLen() const; |