SVCS - English Documentation
Loading...
Searching...
No Matches
svcs::server::cli::RepoCommand Class Reference

Command handler for managing repository remotes and configurations. More...

#include <RepoCommand.hxx>

Inheritance diagram for svcs::server::cli::RepoCommand:
svcs::server::cli::ServerBaseCommand svcs::cli::ICommand

Public Member Functions

 RepoCommand (std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
 Constructs a RepoCommand.
std::string getName () const override
 Gets the name of the command.
std::string getDescription () const override
 Gets a brief description of the command.
std::string getUsage () const override
 Gets the usage syntax of the command.
bool execute (const std::vector< std::string > &args) override
 Executes the RepoCommand logic.
void showHelp () const override
 Displays help information for the command.
Public Member Functions inherited from svcs::server::cli::ServerBaseCommand
 ServerBaseCommand (std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
 Constructs a ServerBaseCommand with necessary dependencies.
virtual ~ServerBaseCommand ()=default
 Virtual destructor for proper cleanup of derived classes.
Public Member Functions inherited from svcs::cli::ICommand
virtual ~ICommand ()=default
 Virtual destructor.

Additional Inherited Members

Protected Member Functions inherited from svcs::server::cli::ServerBaseCommand
void notifyInfo (const std::string &message) const
 Sends an informational notification via the event bus.
void notifyError (const std::string &message) const
 Sends an error notification via the event bus.
Protected Attributes inherited from svcs::server::cli::ServerBaseCommand
std::shared_ptr< ISubjectevent_bus_
 Shared pointer to the event bus for system notifications.
std::shared_ptr< RepositoryManagerrepo_manager_
 Shared pointer to the repository manager for repository operations.

Detailed Description

Command handler for managing repository remotes and configurations.

Implements the "svcs repo" command, providing subcommands for managing the list of remote repositories associated with the current project. Inherits from ServerBaseCommand for common server command functionality.

Constructor & Destructor Documentation

◆ RepoCommand()

svcs::server::cli::RepoCommand::RepoCommand ( std::shared_ptr< ISubject > event_bus,
std::shared_ptr< RepositoryManager > repo_manager )

Constructs a RepoCommand.

Parameters
event_busThe application's event bus.
repo_managerThe repository locator and manager.

Member Function Documentation

◆ execute()

bool svcs::server::cli::RepoCommand::execute ( const std::vector< std::string > & args)
overridevirtual

Executes the RepoCommand logic.

Parameters
argsThe list of arguments, where args[0] is expected to be a subcommand (e.g., "add", "remove").
Returns
bool True if the command executes successfully, false otherwise.

Finds the current repository and delegates the task based on the subcommand.

Implements svcs::server::cli::ServerBaseCommand.

◆ getDescription()

std::string svcs::server::cli::RepoCommand::getDescription ( ) const
overridevirtual

Gets a brief description of the command.

Returns
Description of the command's purpose.

Implements svcs::server::cli::ServerBaseCommand.

◆ getName()

std::string svcs::server::cli::RepoCommand::getName ( ) const
overridevirtual

Gets the name of the command.

Returns
The command name "repo".

Implements svcs::server::cli::ServerBaseCommand.

◆ getUsage()

std::string svcs::server::cli::RepoCommand::getUsage ( ) const
overridevirtual

Gets the usage syntax of the command.

Returns
The usage syntax string.

Implements svcs::server::cli::ServerBaseCommand.

◆ showHelp()

void svcs::server::cli::RepoCommand::showHelp ( ) const
overridevirtual

Displays help information for the command.

Implements svcs::server::cli::ServerBaseCommand.


The documentation for this class was generated from the following files: