yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
project_bundle_archive_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_ROM_PROJECT_BUNDLE_ARCHIVE_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_ROM_PROJECT_BUNDLE_ARCHIVE_COMMANDS_H_
3
5
6namespace yaze::cli::handlers {
7
8// Pack a .yazeproj bundle directory into a .zip archive for cross-platform
9// sharing. Preserves the bundle root folder name inside the archive.
10//
11// Exit 0 on success, 1 on validation failure or write error.
13 public:
14 std::string GetName() const override { return "project-bundle-pack"; }
15 std::string GetUsage() const override {
16 return "project-bundle-pack --project <path.yazeproj> --out <archive.zip> "
17 "[--overwrite] [--format <json|text>]";
18 }
19 bool RequiresRom() const override { return false; }
20 Descriptor Describe() const override;
21 absl::Status ValidateArgs(
22 const resources::ArgumentParser& parser) override;
23 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
24 resources::OutputFormatter& formatter) override;
25};
26
27// Unpack a .zip archive into a .yazeproj bundle directory. Enforces path
28// traversal safety (rejects ".." and absolute-path entries).
29//
30// Exit 0 on success, 1 on validation failure or extraction error.
32 public:
33 std::string GetName() const override { return "project-bundle-unpack"; }
34 std::string GetUsage() const override {
35 return "project-bundle-unpack --archive <archive.zip> "
36 "--out <directory> [--overwrite] [--dry-run] "
37 "[--keep-partial-output] [--format <json|text>]";
38 }
39 bool RequiresRom() const override { return false; }
40 Descriptor Describe() const override;
41 absl::Status ValidateArgs(
42 const resources::ArgumentParser& parser) override;
43 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
44 resources::OutputFormatter& formatter) override;
45};
46
47} // namespace yaze::cli::handlers
48
49#endif // YAZE_SRC_CLI_HANDLERS_ROM_PROJECT_BUNDLE_ARCHIVE_COMMANDS_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
bool RequiresRom() const override
Check if the command requires a loaded ROM.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const override
Get the command name.
std::string GetUsage() const override
Get the command usage string.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
Descriptor Describe() const override
Provide metadata for TUI/help summaries.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const override
Get the command name.
bool RequiresRom() const override
Check if the command requires a loaded ROM.
std::string GetUsage() const override
Get the command usage string.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.