|
SVCS - English Documentation
|
Command to revert the repository state to a previous commit. More...
#include <UndoCommand.hxx>
Public Member Functions | |
| UndoCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager) | |
| Constructor for UndoCommand. | |
| bool | execute (const std::vector< std::string > &args) override |
| Executes the undo command based on the provided arguments. | |
| std::string | getName () const override |
| Gets the command's primary name. | |
| std::string | getDescription () const override |
| Gets the short description of the command. | |
| std::string | getUsage () const override |
| Gets the usage syntax of the command. | |
| void | showHelp () const override |
| Displays detailed help information for the command. | |
| Public Member Functions inherited from svcs::cli::ICommand | |
| virtual | ~ICommand ()=default |
| Virtual destructor. | |
Command to revert the repository state to a previous commit.
Implements the 'svcs undo' functionality. It uses the RepositoryManager to perform the actual history and working directory manipulation. It utilizes the ISubject (event bus) for user output and confirmation prompts.
| svcs::cli::UndoCommand::UndoCommand | ( | std::shared_ptr< ISubject > | subject, |
| std::shared_ptr< RepositoryManager > | repoManager ) |
Constructor for UndoCommand.
| subject | Shared pointer to the event bus for communication (output, prompts). |
| repoManager | Shared pointer to the RepositoryManager for core repository operations. |
|
overridevirtual |
Executes the undo command based on the provided arguments.
Parses arguments for a specific commit hash or the --force flag. If no hash is provided, it attempts to undo the last commit.
| args | The command-line arguments (e.g., commit hash, –force). |
Implements svcs::cli::ICommand.
|
nodiscardoverridevirtual |
Gets the short description of the command.
Implements svcs::cli::ICommand.
|
nodiscardoverridevirtual |
|
nodiscardoverridevirtual |
Gets the usage syntax of the command.
Implements svcs::cli::ICommand.
|
overridevirtual |
Displays detailed help information for the command.
Implements svcs::cli::ICommand.