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

Command for creating central hub repositories for team collaboration. More...

#include <HubCommand.hxx>

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

Public Member Functions

 HubCommand (std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repository_manager)
 Constructs a HubCommand with necessary dependencies.
 ~HubCommand () override=default
 Default destructor.
std::string getName () const override
 Gets the name of the command.
std::string getDescription () const override
 Gets a brief description of the command's purpose.
std::string getUsage () const override
 Gets the usage syntax for the command.
bool execute (const std::vector< std::string > &args) override
 Executes the hub command with provided arguments.
void showHelp () const override
 Displays help information for the hub 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 for creating central hub repositories for team collaboration.

Implements the 'svcs hub' functionality to initialize bare repositories that act as central points for pushing, pulling and collaborating on code. This command is essential for setting up remote collaboration infrastructure. Inherits from ServerBaseCommand for common server command functionality.

Constructor & Destructor Documentation

◆ HubCommand()

svcs::server::cli::HubCommand::HubCommand ( std::shared_ptr< ISubject > event_bus,
std::shared_ptr< RepositoryManager > repository_manager )

Constructs a HubCommand with necessary dependencies.

Parameters
event_busThe event bus for notification system, used for user feedback.
repository_managerThe repository manager for core repository operations.

Member Function Documentation

◆ execute()

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

Executes the hub command with provided arguments.

Parameters
argsCommand line arguments passed to the hub command.
Returns
bool True if command executed successfully, false otherwise.
Exceptions
std::filesystem_errorIf filesystem operations fail.
std::runtime_errorIf repository initialization fails.

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

◆ getDescription()

std::string svcs::server::cli::HubCommand::getDescription ( ) const
nodiscardoverridevirtual

Gets a brief description of the command's purpose.

Returns
std::string Description of the hub command functionality.

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

◆ getName()

std::string svcs::server::cli::HubCommand::getName ( ) const
nodiscardoverridevirtual

Gets the name of the command.

Returns
std::string The command name "hub".

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

◆ getUsage()

std::string svcs::server::cli::HubCommand::getUsage ( ) const
nodiscardoverridevirtual

Gets the usage syntax for the command.

Returns
std::string The usage pattern for the hub command.

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

◆ showHelp()

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

Displays help information for the hub command.

Shows usage examples, argument descriptions, and command purpose to assist users in proper command usage.

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


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