diff options
| author | hr0nix <[email protected]> | 2022-02-10 16:49:59 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:59 +0300 | 
| commit | bee0f5f332db3abff5839ff24ac18000c161a30a (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/getopt/small | |
| parent | ba105fe2a44ef4553a9c1dabc9c632702a59c965 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/getopt/small')
| -rw-r--r-- | library/cpp/getopt/small/modchooser.cpp | 28 | ||||
| -rw-r--r-- | library/cpp/getopt/small/modchooser.h | 30 | 
2 files changed, 29 insertions, 29 deletions
| diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 5a4bbea0340..2fa5cfd0703 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -69,15 +69,15 @@ TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString&  {  } -TModChooser::TModChooser()  +TModChooser::TModChooser()      : ModesHelpOption("-?") // Default help option in last_getopt      , VersionHandler(nullptr)      , ShowSeparated(true)      , SvnRevisionOptionDisabled(false)      , PrintShortCommandInUsage(false) -{  -}  -  +{ +} +  TModChooser::~TModChooser() = default;  void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) { @@ -133,13 +133,13 @@ void TModChooser::SetDescription(const TString& descr) {  }  void TModChooser::SetModesHelpOption(const TString& helpOption) { -    ModesHelpOption = helpOption;  -}  -  -void TModChooser::SetVersionHandler(TVersionHandlerPtr handler) {  -    VersionHandler = handler;  -}  -  +    ModesHelpOption = helpOption; +} + +void TModChooser::SetVersionHandler(TVersionHandlerPtr handler) { +    VersionHandler = handler; +} +  void TModChooser::SetSeparatedMode(bool separated) {      ShowSeparated = separated;  } @@ -185,9 +185,9 @@ int TModChooser::Run(const int argc, const char** argv) const {          return 0;      }      if (VersionHandler && (modeName == "-v" || modeName == "--version")) { -        VersionHandler();  -        return 0;  -    }  +        VersionHandler(); +        return 0; +    }      if (!SvnRevisionOptionDisabled && modeName == "--svnrevision") {          NLastGetopt::PrintVersionAndExit(nullptr);      } diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index db323f47ef2..0a8de6d50b5 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -30,9 +30,9 @@ public:      virtual ~TMainClass() = default;  }; -//! Function to handle '--version' parameter  -typedef void (*TVersionHandlerPtr)();  -  +//! Function to handle '--version' parameter +typedef void (*TVersionHandlerPtr)(); +  /*! Main class for handling different modes in single tool.   *   * You can add modes for this class, use autogenerated help with @@ -43,7 +43,7 @@ typedef void (*TVersionHandlerPtr)();   */  class TModChooser {  public: -    TModChooser();  +    TModChooser();      ~TModChooser();  public: @@ -67,10 +67,10 @@ public:      //! Set modes help option name (-? is by default)      void SetModesHelpOption(const TString& helpOption); -  -    //! Specify handler for '--version' parameter  -    void SetVersionHandler(TVersionHandlerPtr handler);  -  + +    //! Specify handler for '--version' parameter +    void SetVersionHandler(TVersionHandlerPtr handler); +      //! Set description show mode      void SetSeparatedMode(bool separated = true); @@ -89,9 +89,9 @@ public:       * In this method following things happen:       *   1) If first argument is -h/--help/-? then print short description of       *      all modes and exit with zero code. -     *   2) If first argument is -v/--version and version handler is specified,  +     *   2) If first argument is -v/--version and version handler is specified,       *      then call it and exit with zero code. -     *   3) Find mode with the same name as first argument. If it's found then  +     *   3) Find mode with the same name as first argument. If it's found then       *      call it and return its return code.       *   4) If appropriate mode is not found - return non-zero code.       */ @@ -138,19 +138,19 @@ private:      //! Main program description.      TString Description; -    //! Help option for modes.  +    //! Help option for modes.      TString ModesHelpOption; -  +      //! Wrappers around all modes.      TVector<THolder<TMainClass>> Wrappers;      //! Modes      TMap<TString, TMode*> Modes; -  +      TString DefaultMode; -    //! Handler for '--version' parameter  -    TVersionHandlerPtr VersionHandler;  +    //! Handler for '--version' parameter +    TVersionHandlerPtr VersionHandler;      //! When set to true, show descriptions unsorted and display separators      bool ShowSeparated; | 
