Implements the "add" command for the Simple Version Control System (SVCS).
More...
#include <AddCommand.hxx>
|
| | AddCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager) |
| | Constructor for AddCommand.
|
| bool | execute (const std::vector< std::string > &args) override |
| | Executes the "add" command with the given arguments.
|
| std::vector< std::string > | getAllFilesInDirectory (const std::string &directory) const |
| | Retrieves all file paths within a given directory, recursively.
|
| 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 command's usage syntax.
|
| void | showHelp () const override |
| | Displays the detailed help information for the command.
|
| Public Member Functions inherited from svcs::cli::ICommand |
| virtual | ~ICommand ()=default |
| | Virtual destructor.
|
Implements the "add" command for the Simple Version Control System (SVCS).
This command is responsible for adding (staging) the specified files to the staging area of the repository for a subsequent commit. The class inherits from ICommand and uses the Command pattern to execute its operations. It depends on ISubject (event bus) for user notifications and RepositoryManager for repository operations.
◆ AddCommand()
◆ execute()
| bool svcs::cli::AddCommand::execute |
( |
const std::vector< std::string > & | args | ) |
|
|
overridevirtual |
Executes the "add" command with the given arguments.
- Parameters
-
| args | The vector of string arguments for the command. |
- Returns
- true if the command executed successfully, false otherwise.
Implements svcs::cli::ICommand.
◆ getAllFilesInDirectory()
| std::vector< std::string > svcs::cli::AddCommand::getAllFilesInDirectory |
( |
const std::string & | directory | ) |
const |
|
nodiscard |
Retrieves all file paths within a given directory, recursively.
- Parameters
-
| directory | The path to the directory. |
- Returns
- A vector of strings containing all file paths.
◆ getDescription()
| std::string svcs::cli::AddCommand::getDescription |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets a brief description of the command.
- Returns
- A string describing the command's purpose.
Implements svcs::cli::ICommand.
◆ getName()
| std::string svcs::cli::AddCommand::getName |
( |
| ) |
const |
|
inlinenodiscardoverridevirtual |
◆ getUsage()
| std::string svcs::cli::AddCommand::getUsage |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the command's usage syntax.
- Returns
- A string showing how to use the command.
Implements svcs::cli::ICommand.
◆ showHelp()
| void svcs::cli::AddCommand::showHelp |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: