diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-11 01:54:25 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-01-18 08:20:08 -0500 |
| commit | 06109a568be5d31ebb3303b4702dec7185f22066 (patch) | |
| tree | fe0b95c66f2d43ddd3f9449ea7949560cd8dc004 /src/commandline.h | |
| parent | 65a9e51e0ed8169bbf2a176ce147ca5a9ae09a6f (diff) | |
put more stuff in Meta to simplify
Diffstat (limited to 'src/commandline.h')
| -rw-r--r-- | src/commandline.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/commandline.h b/src/commandline.h index 9cad4c71..a92ef094 100644 --- a/src/commandline.h +++ b/src/commandline.h @@ -28,11 +28,11 @@ public: // std::string description() const; - // usage line, puts together the name and whatever getUsageLine() returns + // usage line, puts together the name and whatever meta().usage is // std::string usageLine() const; - // shown after the usage line + // shown after the usage line; this is meta().more // std::string moreInfo() const; @@ -74,16 +74,12 @@ protected: // struct Meta { - std::string name, description; - }; - - // returns the usage line for this command, not including the name - // - virtual std::string getUsageLine() const; + std::string name, description, usage, more; - // returns text shown after the usage line - // - virtual std::string getMoreInfo() const; + Meta( + std::string name, std::string description, + std::string usage, std::string more); + }; // returns visible options specific to this command // @@ -166,13 +162,11 @@ protected: class RunCommand : public Command { protected: - std::string getUsageLine() const override; - std::string getMoreInfo() const override; + Meta meta() const override; po::options_description getVisibleOptions() const override; po::options_description getInternalOptions() const override; po::positional_options_description getPositional() const override; - Meta meta() const override; bool canForwardToPrimary() const override; std::optional<int> runPostOrganizer(OrganizerCore& core) override; @@ -184,11 +178,10 @@ protected: class ReloadPluginCommand : public Command { protected: - std::string getUsageLine() const override; + Meta meta() const override; po::options_description getInternalOptions() const override; po::positional_options_description getPositional() const override; - Meta meta() const override; bool canForwardToPrimary() const override; std::optional<int> runPostOrganizer(OrganizerCore& core) override; |
