SVCS - English Documentation
Loading...
Searching...
No Matches
ICommand.hxx
Go to the documentation of this file.
1
19#pragma once
20
21#include <string>
22#include <vector>
23
34 * @details Содержит все CLI команды, с которыми пользователи взаимодействуют напрямую,
35 * включая AddCommand, CommitCommand, StatusCommand и другие.
36 */
37namespace svcs::cli {
38
52class ICommand {
53public:
63 virtual ~ICommand() = default;
64
74 [[nodiscard]] virtual std::string getName() const = 0;
75
78
85 [[nodiscard]] virtual std::string getDescription() const = 0;
86
96 [[nodiscard]] virtual std::string getUsage() const = 0;
97
109 virtual bool execute(const std::vector<std::string>& args) = 0;
110
118 virtual void showHelp() const = 0;
119};
120
121}
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
virtual std::string getName() const =0
Retrieves the unique name of the command (e.g., "init").
virtual std::string getDescription() const =0
Retrieves a brief description of what the command does.
virtual bool execute(const std::vector< std::string > &args)=0
Executes the main logic of the command.
virtual void showHelp() const =0
Displays detailed help information about the command (Usage and Description).
virtual ~ICommand()=default
Virtual destructor.
virtual std::string getUsage() const =0
Retrieves the command's usage syntax.
Command-line interface components and command implementations.