106 std::shared_ptr<ISubject> eventBus_;
107 std::shared_ptr<RepositoryManager> repoManager_;
133 bool interactive =
false;
178 std::vector<std::string> files;
187 std::vector<std::string> excludePatterns;
200 [[nodiscard]]
bool addInteractive()
const;
213 [[nodiscard]]
bool addPatch(
const std::string& filePath)
const;
226 [[nodiscard]]
bool showDryRun(
const std::vector<std::string>& files)
const;
241 [[nodiscard]]
bool shouldAddFile(
const std::string& file,
bool force)
const;
255 [[nodiscard]] AddOptions parseArguments(
const std::vector<std::string>& args)
const;
270 std::shared_ptr<RepositoryManager> repoManager);
283 bool execute(
const std::vector<std::string>& args)
override;
307 [[nodiscard]] std::string
getName()
const override {
return "add"; }
329 [[nodiscard]] std::string
getUsage()
const override;
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.
Implements the "add" command for the Simple Version Control System (SVCS).
Definition AddCommand.hxx:71
void showHelp() const override
Displays the detailed help information for the command.
Definition AddCommand.cxx:296
bool execute(const std::vector< std::string > &args) override
Executes the "add" command with the given arguments.
Definition AddCommand.cxx:58
std::string getName() const override
Gets the name of the command.
Definition AddCommand.hxx:203
std::vector< std::string > getAllFilesInDirectory(const std::string &directory) const
Retrieves all file paths within a given directory, recursively.
Definition AddCommand.cxx:269
AddCommand(std::shared_ptr< ISubject > subject, std::shared_ptr< RepositoryManager > repoManager)
Constructor for AddCommand.
Definition AddCommand.cxx:20
std::string getUsage() const override
Gets the command's usage syntax.
Definition AddCommand.cxx:292
std::string getDescription() const override
Gets a brief description of the command.
Definition AddCommand.cxx:288
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
Command-line interface components and command implementations.
FileStatus
Defines the status of a file within the SVCS.
Definition AddCommand.hxx:35
@ MODIFIED
File is tracked and has been modified since the last commit.
Definition AddCommand.hxx:46
@ DELETED
File is tracked but has been deleted from the working directory.
Definition AddCommand.hxx:52
@ UNMODIFIED
File is tracked and has no changes since the last commit.
Definition AddCommand.hxx:58
@ UNTRACKED
File is present but not tracked by SVCS.
Definition AddCommand.hxx:40
Core VCS data structures and object model.