Command for showing the current status of the repository.
More...
#include <StatusCommand.hxx>
|
| | StatusCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager) |
| | Constructs the StatusCommand.
|
| bool | execute (const std::vector< std::string > &args) override |
| | Executes the status 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 showing the current status of the repository.
The StatusCommand displays:
- Current branch
- Staged changes (ready to save)
- Unstaged changes (not yet added)
- Untracked files (new files)
- Status of specific files when provided as arguments
◆ StatusCommand()
| svcs::cli::StatusCommand::StatusCommand |
( |
std::shared_ptr< ISubject > | subject, |
|
|
std::shared_ptr< RepositoryManager > | repoManager ) |
Constructs the StatusCommand.
- Parameters
-
| subject | Shared pointer to the event bus for notifications. |
| repoManager | Shared pointer to the repository manager. |
◆ execute()
| bool svcs::cli::StatusCommand::execute |
( |
const std::vector< std::string > & | args | ) |
|
|
overridevirtual |
Executes the status command.
- Parameters
-
| args | Command arguments - if provided, shows status for specific files. |
- Returns
- true always, as status command cannot fail.
Implements svcs::cli::ICommand.
◆ getDescription()
| std::string svcs::cli::StatusCommand::getDescription |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the description of the command.
- Returns
- "Show the working tree status"
Implements svcs::cli::ICommand.
◆ getName()
| std::string svcs::cli::StatusCommand::getName |
( |
| ) |
const |
|
inlinenodiscardoverridevirtual |
◆ getUsage()
| std::string svcs::cli::StatusCommand::getUsage |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Gets the usage syntax of the command.
- Returns
- "svcs status [file1 file2 ...]"
Implements svcs::cli::ICommand.
◆ showHelp()
| void svcs::cli::StatusCommand::showHelp |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files: