diff options
author | alejandro <alejandro@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:54 +0300 |
commit | a24597741ed0c290312a4e021954d5088e5281a8 (patch) | |
tree | eabcdbc4cc9a530913f0db8b96028f2f3b6d7c88 /library/cpp/getopt | |
parent | 18b9863882c0f9638e4a6599acbcdfe6109d5da0 (diff) | |
download | ydb-a24597741ed0c290312a4e021954d5088e5281a8.tar.gz |
Restoring authorship annotation for <alejandro@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r-- | library/cpp/getopt/small/modchooser.cpp | 32 | ||||
-rw-r--r-- | library/cpp/getopt/small/modchooser.h | 30 |
2 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 2fa5cfd070..37c97f6245 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -61,9 +61,9 @@ private: }; TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& descr, bool hidden, bool noCompletion) - : Name(name) - , Main(main) - , Description(descr) + : Name(name) + , Main(main) + , Description(descr) , Hidden(hidden) , NoCompletion(noCompletion) { @@ -113,8 +113,8 @@ void TModChooser::AddMode(const TString& mode, TMainClassV* func, const TString& void TModChooser::AddGroupModeDescription(const TString& description, bool hidden, bool noCompletion) { UnsortedModes.push_back(MakeHolder<TMode>(TString(), nullptr, description.data(), hidden, noCompletion)); -} - +} + void TModChooser::SetDefaultMode(const TString& mode) { DefaultMode = mode; } @@ -140,14 +140,14 @@ void TModChooser::SetVersionHandler(TVersionHandlerPtr handler) { VersionHandler = handler; } -void TModChooser::SetSeparatedMode(bool separated) { - ShowSeparated = separated; -} - +void TModChooser::SetSeparatedMode(bool separated) { + ShowSeparated = separated; +} + void TModChooser::SetSeparationString(const TString& str) { - SeparationString = str; -} - + SeparationString = str; +} + void TModChooser::SetPrintShortCommandInUsage(bool printShortCommandInUsage = false) { PrintShortCommandInUsage = printShortCommandInUsage; } @@ -289,7 +289,7 @@ void TModChooser::PrintHelp(const TString& progName) const { maxModeLen = Max(maxModeLen, mode->CalculateFullNameLen()); } - if (ShowSeparated) { + if (ShowSeparated) { for (const auto& unsortedMode : UnsortedModes) if (!unsortedMode->Hidden) { if (unsortedMode->Name.size()) { @@ -298,8 +298,8 @@ void TModChooser::PrintHelp(const TString& progName) const { Cerr << SeparationString << Endl; Cerr << unsortedMode->Description << Endl; } - } - } else { + } + } else { for (const auto& mode : Modes) { if (mode.first != mode.second->Name) continue; // this is an alias @@ -308,7 +308,7 @@ void TModChooser::PrintHelp(const TString& progName) const { Cerr << " " << mode.second->FormatFullName(maxModeLen + 4) << mode.second->Description << Endl; } } - } + } Cerr << Endl; Cerr << "To get help for specific mode type '" << progName << " MODE " << ModesHelpOption << "'" << Endl; diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index 0a8de6d50b..620919e882 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -56,7 +56,7 @@ public: //! Hidden groups won't be displayed in 'help' block void AddGroupModeDescription(const TString& description, bool hidden = false, bool noCompletion = false); - + //! Set default mode (if not specified explicitly) void SetDefaultMode(const TString& mode); @@ -71,12 +71,12 @@ public: //! Specify handler for '--version' parameter void SetVersionHandler(TVersionHandlerPtr handler); - //! Set description show mode - void SetSeparatedMode(bool separated = true); - - //! Set separation string + //! Set description show mode + void SetSeparatedMode(bool separated = true); + + //! Set separation string void SetSeparationString(const TString& str); - + //! Set short command representation in Usage block void SetPrintShortCommandInUsage(bool printShortCommandInUsage); @@ -110,11 +110,11 @@ public: bool NoCompletion; TVector<TString> Aliases; - TMode() + TMode() : Main(nullptr) { } - + 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. @@ -151,20 +151,20 @@ private: //! Handler for '--version' parameter TVersionHandlerPtr VersionHandler; - - //! When set to true, show descriptions unsorted and display separators - bool ShowSeparated; - + + //! When set to true, show descriptions unsorted and display separators + bool ShowSeparated; + //! When set to true, disables --svnrevision option, useful for opensource (git hosted) projects bool SvnRevisionOptionDisabled; //! When true - will print only 'mode name' in 'Usage' block bool PrintShortCommandInUsage; - //! Text string used when displaying each separator + //! Text string used when displaying each separator TString SeparationString; - - //! Unsorted list of options + + //! Unsorted list of options TVector<THolder<TMode>> UnsortedModes; //! Mode that generates completions |