SVCS - English Documentation
Loading...
Searching...
No Matches
ClearCommand.hxx
Go to the documentation of this file.
1
13#pragma once
14
15#include "ICommand.hxx"
18
19#include <memory>
20#include <string>
21#include <vector>
22
36namespace svcs::cli {
37
38using namespace svcs::core;
39
49class ClearCommand : public ICommand {
50private:
58 std::shared_ptr<ISubject> eventBus_;
59
67 std::shared_ptr<RepositoryManager> repoManager_;
68
69public:
81 ClearCommand(std::shared_ptr<ISubject> subject,
82 std::shared_ptr<RepositoryManager> repoManager);
83
95 bool execute(const std::vector<std::string>& args) override;
96
106 [[nodiscard]] std::string getName() const override { return "clear"; }
107
110
117 [[nodiscard]] std::string getDescription() const override;
118
128 [[nodiscard]] std::string getUsage() const override;
129
137 void showHelp() const override;
138
139private:
149 [[nodiscard]] static bool confirmClear();
150
160 [[nodiscard]] bool removeRepository() const;
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.
Declaration of the RepositoryManager class, managing all repository-level file operations.
std::string getName() const override
Gets the name of the command.
Definition ClearCommand.hxx:73
std::string getDescription() const override
Gets the description of the command.
Definition ClearCommand.cxx:99
void showHelp() const override
Shows detailed help information for this command.
Definition ClearCommand.cxx:107
bool execute(const std::vector< std::string > &args) override
Executes the clear command.
Definition ClearCommand.cxx:26
ClearCommand(std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager)
Constructs the ClearCommand.
Definition ClearCommand.cxx:21
std::string getUsage() const override
Gets the usage syntax of the command.
Definition ClearCommand.cxx:103
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
Command-line interface components and command implementations.
Core VCS data structures and object model.