SVCS - English Documentation
Loading...
Searching...
No Matches
VersionCommand.hxx
Go to the documentation of this file.
1
13#pragma once
14
15#include "ICommand.hxx"
17
18#include <memory>
19#include <vector>
20#include <string>
21
35namespace svcs::cli {
37using namespace svcs::services;
38
50class VersionCommand : public ICommand {
51private:
59 std::shared_ptr<ISubject> eventBus_;
60
61public:
71 explicit VersionCommand(std::shared_ptr<ISubject> subject);
72
84 bool execute(const std::vector<std::string>& args) override;
85
95 [[nodiscard]] std::string getName() const override { return "version"; }
96
106 [[nodiscard]] std::string getDescription() const override;
107
109
117 [[nodiscard]] std::string getUsage() const override;
118
126 void showHelp() const override;
127
128private:
138 [[nodiscard]] static std::string getVersionString();
139
149 [[nodiscard]] static std::string getBuildInfo();
150
160 [[nodiscard]] static std::string getCopyright();
161};
162
163}
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
bool execute(const std::vector< std::string > &args) override
Executes the version command.
Definition VersionCommand.cxx:24
void showHelp() const override
Shows detailed help information for this command.
Definition VersionCommand.cxx:47
std::string getName() const override
Gets the name of the command.
Definition VersionCommand.hxx:65
std::string getDescription() const override
Gets the description of the command.
Definition VersionCommand.cxx:39
VersionCommand(std::shared_ptr< ISubject > subject)
Constructs the VersionCommand.
Definition VersionCommand.cxx:20
std::string getUsage() const override
Gets the usage syntax of the command.
Definition VersionCommand.cxx:43
Command-line interface components and command implementations.
Service layer components and infrastructure services.