summaryrefslogtreecommitdiff
path: root/src/commandline.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandline.h')
-rw-r--r--src/commandline.h25
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;