SVCS - English Documentation
Loading...
Searching...
No Matches
svcs::test::cli::utils::HistoryCommand Class Reference

Command for viewing the history of saves (commits) in the repository. More...

#include <HistoryCommand.hxx>

Inheritance diagram for svcs::test::cli::utils::HistoryCommand:
svcs::cli::ICommand

Public Member Functions

 HistoryCommand (std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager)
 Constructor for HistoryCommand.
bool execute (const std::vector< std::string > &args) override
 Executes the "history" command with the given arguments.
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.

Detailed Description

Command for viewing the history of saves (commits) in the repository.

The HistoryCommand displays the chronological history of all saves with their messages, authors, timestamps, and unique identifiers. It supports different output formats, including default, one-line, and detailed views.

Constructor & Destructor Documentation

◆ HistoryCommand()

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

Constructor for HistoryCommand.

Parameters
subjectA shared pointer to the ISubject (event bus).
repoManagerA shared pointer to the RepositoryManager.

Member Function Documentation

◆ execute()

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

Executes the "history" command with the given arguments.

This method is the main entry point for the command, handling argument parsing and delegating to the appropriate history display function.

Parameters
argsThe vector of string arguments for the command (e.g., limit, format options).
Returns
true if the command executed successfully, false otherwise.

Implements svcs::cli::ICommand.

◆ getDescription()

std::string svcs::cli::HistoryCommand::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::HistoryCommand::getName ( ) const
inlinenodiscardoverridevirtual

Gets the name of the command.

Returns
The command name, "history".

Implements svcs::cli::ICommand.

◆ getUsage()

std::string svcs::cli::HistoryCommand::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::HistoryCommand::showHelp ( ) const
overridevirtual

Displays the detailed help information for the command.

Implements svcs::cli::ICommand.


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