SVCS - English Documentation
Loading...
Searching...
No Matches
HelpCommand.hxx
Go to the documentation of this file.
1
13#pragma once
14
15#include "ICommand.hxx"
18
19#include <memory>
20#include <vector>
21#include <string>
22
36namespace svcs::cli {
53class HelpCommand : public ICommand {
54private:
62 std::shared_ptr<ISubject> eventBus_;
63
71 std::shared_ptr<HelpService> helpService_;
72
73public:
85 HelpCommand(std::shared_ptr<ISubject> subject,
86 std::shared_ptr<HelpService> helpService);
87
101 bool execute(const std::vector<std::string>& args) override;
102
112 [[nodiscard]] std::string getName() const override { return "help"; }
113
123 [[nodiscard]] std::string getDescription() const override;
124
134 [[nodiscard]] std::string getUsage() const override;
135
143 void showHelp() const override;
144
145private:
155 void showGeneralHelp() const;
156
168 void showCommandHelp(const std::string& commandName) const;
169};
170
171}
Service for providing help information about commands.
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
std::string getUsage() const override
Gets the usage syntax of the command.
Definition HelpCommand.cxx:39
std::string getDescription() const override
Gets the brief description of the command.
Definition HelpCommand.cxx:35
void showHelp() const override
Shows detailed help information for this specific command via the event bus.
Definition HelpCommand.cxx:43
bool execute(const std::vector< std::string > &args) override
Executes the help command logic.
Definition HelpCommand.cxx:25
std::string getName() const override
Gets the name of the command.
Definition HelpCommand.hxx:75
HelpCommand(std::shared_ptr< ISubject > subject, std::shared_ptr< HelpService > helpService)
Constructs the HelpCommand.
Definition HelpCommand.cxx:20
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
Command-line interface components and command implementations.