|
SVCS - English Documentation
|
Implements the "init" command for the Version Control System (VCS). More...
#include <InitCommand.hxx>
Public Member Functions | |
| InitCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager) | |
| Constructs an InitCommand. | |
| bool | execute (const std::vector< std::string > &args) override |
| Executes the repository initialization logic. | |
| std::string | getName () const override |
| Returns the command name. | |
| std::string | getDescription () const override |
| Returns a brief description of the command's purpose. | |
| std::string | getUsage () const override |
| Returns the usage syntax for the command. | |
| void | showHelp () const override |
| Displays detailed help information about the command via the event bus. | |
| Public Member Functions inherited from svcs::cli::ICommand | |
| virtual | ~ICommand ()=default |
| Virtual destructor. | |
Implements the "init" command for the Version Control System (VCS).
This command is responsible for initializing a new SVCS repository in the current directory or a specified location, setting up the necessary internal structure (e.g., the hidden .svcs directory). The class inherits from ICommand, ensuring it adheres to the Command pattern interface. It requires an event bus for communication and a repository manager to perform the actual initialization logic.
| svcs::cli::InitCommand::InitCommand | ( | std::shared_ptr< ISubject > | subject, |
| std::shared_ptr< RepositoryManager > | repoManager ) |
Constructs an InitCommand.
| subject | A shared pointer to the event bus (ISubject). |
| repoManager | A shared pointer to the RepositoryManager. |
|
overridevirtual |
Executes the repository initialization logic.
This method attempts to create the repository structure.
| args | A vector of strings containing command-line arguments (usually empty for 'init'). |
true if the repository was successfully initialized or if it already exists, false if the initialization failed. Implements svcs::cli::ICommand.
|
nodiscardoverridevirtual |
Returns a brief description of the command's purpose.
Implements svcs::cli::ICommand.
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
Returns the usage syntax for the command.
Implements svcs::cli::ICommand.
|
overridevirtual |
Displays detailed help information about the command via the event bus.
Implements svcs::cli::ICommand.