SVCS - English Documentation
Loading...
Searching...
No Matches
svcs::cli::StatusCommand Class Reference

Command for showing the current status of the repository. More...

#include <StatusCommand.hxx>

Inheritance diagram for svcs::cli::StatusCommand:
svcs::cli::ICommand

Public Member Functions

 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.

Detailed Description

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

Constructor & Destructor Documentation

◆ StatusCommand()

svcs::cli::StatusCommand::StatusCommand ( std::shared_ptr< ISubject > subject,
std::shared_ptr< RepositoryManager > repoManager )

Constructs the StatusCommand.

Parameters
subjectShared pointer to the event bus for notifications.
repoManagerShared pointer to the repository manager.

Member Function Documentation

◆ execute()

bool svcs::cli::StatusCommand::execute ( const std::vector< std::string > & args)
overridevirtual

Executes the status command.

Parameters
argsCommand 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

Gets the name of the command.

Returns
"status"

Implements svcs::cli::ICommand.

◆ 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

Shows detailed help information for this command.

Implements svcs::cli::ICommand.


The documentation for this class was generated from the following files: