Command for saving (committing) staged changes to the repository.
More...
#include <SaveCommand.hxx>
|
| | SaveCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager) |
| | Constructs the SaveCommand.
|
| bool | execute (const std::vector< std::string > &args) override |
| | Executes the save command.
|
| std::string | getName () const override |
| | Gets the name of the command.
|
| std::string | getDescription () const override |
| | Gets the description of the command.
|
| std::string | getUsage () const override |
| | Gets the usage syntax of the command.
|
| void | showHelp () const override |
| | Shows detailed help information for this command.
|
| Public Member Functions inherited from svcs::cli::ICommand |
| virtual | ~ICommand ()=default |
| | Virtual destructor.
|
Command for saving (committing) staged changes to the repository.
The SaveCommand creates a permanent snapshot of all staged changes with a descriptive message.
◆ SaveCommand()
| svcs::cli::SaveCommand::SaveCommand |
( |
std::shared_ptr< ISubject > | subject, |
|
|
std::shared_ptr< RepositoryManager > | repoManager ) |
Constructs the SaveCommand.
- Parameters
-
| subject | Shared pointer to the event bus for notifications. |
| repoManager | Shared pointer to the repository manager. |
◆ execute()
| bool svcs::cli::SaveCommand::execute |
( |
const std::vector< std::string > & | args | ) |
|
|
overridevirtual |
Executes the save command.
- Parameters
-
| args | Command arguments. Expected format: ["-m", "message"] or ["--message", "message"] |
- Returns
- true if save succeeded, false otherwise.
Implements svcs::cli::ICommand.
◆ getDescription()
| std::string svcs::cli::SaveCommand::getDescription |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the description of the command.
- Returns
- "Save staged changes to the repository"
Implements svcs::cli::ICommand.
◆ getName()
| std::string svcs::cli::SaveCommand::getName |
( |
| ) |
const |
|
inlinenodiscardoverridevirtual |
◆ getUsage()
| std::string svcs::cli::SaveCommand::getUsage |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the usage syntax of the command.
- Returns
- "svcs save -m \"message\""
Implements svcs::cli::ICommand.
◆ showHelp()
| void svcs::cli::SaveCommand::showHelp |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: