Command for displaying help information about other commands.
More...
#include <HelpCommand.hxx>
|
| | HelpCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< HelpService > helpService) |
| | Constructs the HelpCommand.
|
| bool | execute (const std::vector< std::string > &args) override |
| | Executes the help command logic.
|
| std::string | getName () const override |
| | Gets the name of the command.
|
| std::string | getDescription () const override |
| | Gets the brief description of the command.
|
| std::string | getUsage () const override |
| | Gets the usage syntax of the command.
|
| void | showHelp () const override |
| | Shows detailed help information for this specific command via the event bus.
|
| Public Member Functions inherited from svcs::cli::ICommand |
| virtual | ~ICommand ()=default |
| | Virtual destructor.
|
Command for displaying help information about other commands.
The HelpCommand is the application's built-in help utility. It can show a general list of all available commands or display detailed usage and descriptions for a specific command provided as an argument. It delegates the retrieval of command information to the HelpService to maintain a clean separation of concerns.
◆ HelpCommand()
| svcs::cli::HelpCommand::HelpCommand |
( |
std::shared_ptr< ISubject > | subject, |
|
|
std::shared_ptr< HelpService > | helpService ) |
Constructs the HelpCommand.
- Parameters
-
| subject | Shared pointer to the event bus for logging and output notifications. |
| helpService | Shared pointer to the help service dependency. |
◆ execute()
| bool svcs::cli::HelpCommand::execute |
( |
const std::vector< std::string > & | args | ) |
|
|
overridevirtual |
Executes the help command logic.
- Parameters
-
| args | Command arguments. If the vector is empty, general help is shown. If it contains one command name, detailed help for that command is shown. |
- Returns
true always, as the help command is not expected to encounter a runtime failure.
Implements svcs::cli::ICommand.
◆ getDescription()
| std::string svcs::cli::HelpCommand::getDescription |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the brief description of the command.
- Returns
- The string "Show help information for commands".
Implements svcs::cli::ICommand.
◆ getName()
| std::string svcs::cli::HelpCommand::getName |
( |
| ) |
const |
|
inlinenodiscardoverridevirtual |
◆ getUsage()
| std::string svcs::cli::HelpCommand::getUsage |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the usage syntax of the command.
- Returns
- The string "svcs help [command]".
Implements svcs::cli::ICommand.
◆ showHelp()
| void svcs::cli::HelpCommand::showHelp |
( |
| ) |
const |
|
overridevirtual |
Shows detailed help information for this specific command via the event bus.
Implements svcs::cli::ICommand.
The documentation for this class was generated from the following files: