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 | fb217752f4b5a81abe9df05e38c5a71d080fc2a8 (patch) | |
tree | b61080bac892e4d99c55a947c93ddee756202193 /library/cpp/getopt | |
parent | c3356aebb686e7128a19f75ef61d57388131f12f (diff) | |
download | ydb-fb217752f4b5a81abe9df05e38c5a71d080fc2a8.tar.gz |
Restoring authorship annotation for <tldr@yandex-team.ru>. Commit 1 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 ac41988217e..3e8a5302b47 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 2fa5cfd0703..3e37a768e1e 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 0a8de6d50b5..2b9cf2246bd 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; |