From 06109a568be5d31ebb3303b4702dec7185f22066 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Mon, 11 Jan 2021 01:54:25 -0500 Subject: put more stuff in Meta to simplify --- src/commandline.h | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'src/commandline.h') 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 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 runPostOrganizer(OrganizerCore& core) override; -- cgit v1.3.1