39using namespace svcs::core;
40using namespace svcs::services;
70 std::shared_ptr<ISubject> eventBus_;
79 std::shared_ptr<RepositoryManager> repoManager_;
94 std::shared_ptr<RepositoryManager> repoManager);
107 bool execute(
const std::vector<std::string>& args)
override;
118 [[nodiscard]] std::string
getName()
const override {
return "status"; }
140 [[nodiscard]] std::string
getUsage()
const override;
161 [[nodiscard]]
bool showFullStatus()
const;
174 [[nodiscard]]
bool showFileStatus(
const std::vector<std::string>& files)
const;
183 void showBranchInfo()
const;
192 void showStagedChanges()
const;
201 void showUnstagedChanges()
const;
210 void showUntrackedFiles()
const;
221 [[nodiscard]] std::string getCurrentBranch()
const;
234 [[nodiscard]]
bool isFileModified(
const std::filesystem::path& filePath)
const;
245 [[nodiscard]] std::vector<std::filesystem::path> findUntrackedFiles()
const;
260 [[nodiscard]]
static std::string formatFileStatus(
char status,
const std::string& filePath);
273 [[nodiscard]] std::pair<char, std::string> getFileStatus(
const std::string& filePath)
const;
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Declaration of the RepositoryManager class, managing all repository-level file operations.
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
void showHelp() const override
Shows detailed help information for this command.
Definition StatusCommand.cxx:130
std::string getUsage() const override
Gets the usage syntax of the command.
Definition StatusCommand.cxx:126
std::string getName() const override
Gets the name of the command.
Definition StatusCommand.hxx:80
std::string getDescription() const override
Gets the description of the command.
Definition StatusCommand.cxx:122
StatusCommand(std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager)
Constructs the StatusCommand.
Definition StatusCommand.cxx:26
bool execute(const std::vector< std::string > &args) override
Executes the status command.
Definition StatusCommand.cxx:31
Command-line interface components and command implementations.