SVCS - English Documentation
Loading...
Searching...
No Matches
RepoCommand.hxx
Go to the documentation of this file.
1
27#pragma once
28
29#include "ServerBaseCommand.hxx"
31#include "RemoteManager.hxx"
32#include <memory>
33#include <vector>
34
46 * @brief Компоненты командной строки для администрирования сервера.
47 * @details Содержит CLI команды, специально предназначенные для администрирования и управления сервером,
48 * включая создание репозиториев-хабов, управление пользователями и конфигурацию сервера.
49 * Эти команды используются администраторами для настройки и обслуживания экземпляров сервера SVCS.
50 * Это пространство имен связывает серверную функциональность с интерфейсом командной строки.
51 */
52namespace svcs::server::cli {
53
54using namespace svcs::core;
55
71class RepoCommand : public ServerBaseCommand {
72public:
84 RepoCommand(std::shared_ptr<ISubject> event_bus,
85 std::shared_ptr<RepositoryManager> repo_manager);
86
96 std::string getName() const override;
97
107 std::string getDescription() const override;
108
118 std::string getUsage() const override;
119
133 bool execute(const std::vector<std::string>& args) override;
134
142 void showHelp() const override;
143
144private:
145 // --- Subcommand Handlers ---
146
160 bool handleAdd(RemoteManager& remote_manager, const std::vector<std::string>& args);
161
175 bool handleRemove(RemoteManager& remote_manager, const std::vector<std::string>& args);
176
188 bool handleList(RemoteManager& remote_manager);
189
207 bool handleRename(RemoteManager& remote_manager, const std::vector<std::string>& args);
208};
209
210}
Declaration of the RemoteManager class and Remote struct.
Manages the entire version control repository, acts as a Subject for event logging,...
Base class for server administration commands using ICommand interface.
Manages the repository's remote configurations.
Definition RemoteManager.hxx:79
bool execute(const std::vector< std::string > &args) override
Executes the RepoCommand logic.
Definition RepoCommand.cxx:44
std::string getName() const override
Gets the name of the command.
Definition RepoCommand.cxx:32
std::string getDescription() const override
Gets a brief description of the command.
Definition RepoCommand.cxx:36
void showHelp() const override
Displays help information for the command.
Definition RepoCommand.cxx:162
RepoCommand(std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
Constructs a RepoCommand.
Definition RepoCommand.cxx:26
std::string getUsage() const override
Gets the usage syntax of the command.
Definition RepoCommand.cxx:40
ServerBaseCommand(std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
Constructs a ServerBaseCommand with necessary dependencies.
Definition ServerBaseCommand.cxx:17
Core VCS data structures and object model.
Server administration command-line interface components.