75 std::shared_ptr<BranchManager> branch_manager);
95 [[nodiscard]] std::string
getName()
const override;
117 [[nodiscard]] std::string
getUsage()
const override;
130 bool execute(
const std::vector<std::string>& args)
override;
151 bool listBranches()
const;
164 bool createBranch(
const std::string& branch_name)
const;
179 bool createBranchFromCommit(
const std::string& branch_name,
const std::string& commit_hash)
const;
194 bool deleteBranch(
const std::string& branch_name,
bool force =
false)
const;
209 bool renameBranch(
const std::string& old_name,
const std::string& new_name)
const;
220 bool showCurrentBranch()
const;
233 bool switchBranch(
const std::string& branch_name)
const;
246 [[nodiscard]]
static bool isValidBranchName(
const std::string& name);
259 [[nodiscard]]
bool branchExists(
const std::string& name)
const;
272 [[nodiscard]]
static bool isValidCommitHash(
const std::string& hash);
282 std::shared_ptr<ISubject> event_bus_;
291 std::shared_ptr<BranchManager> branch_manager_;
Declaration of the BranchManager class for handling version control branches.
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
std::string getUsage() const override
Gets the command usage syntax.
Definition BranchCommand.cxx:38
~BranchCommand() override=default
Destructor.
std::string getName() const override
Gets the command name.
Definition BranchCommand.cxx:30
std::string getDescription() const override
Gets the command description.
Definition BranchCommand.cxx:34
BranchCommand(std::shared_ptr< ISubject > event_bus, std::shared_ptr< BranchManager > branch_manager)
Constructor for BranchCommand.
Definition BranchCommand.cxx:25
bool execute(const std::vector< std::string > &args) override
Executes the branch command with given arguments.
Definition BranchCommand.cxx:92
void showHelp() const override
Displays help information for the command.
Definition BranchCommand.cxx:192
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
Command-line interface components and command implementations.
Core VCS data structures and object model.