yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
message_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_MESSAGE_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_MESSAGE_COMMANDS_H_
3
5
6namespace yaze {
7namespace cli {
8namespace handlers {
9
14 public:
15 std::string GetName() const { return "message-list"; }
16 std::string GetDescription() const { return "List available messages"; }
17 std::string GetUsage() const {
18 return "message-list [--limit <limit>] [--format <json|text>]";
19 }
20
21 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
22 return absl::OkStatus(); // No required args
23 }
24
25 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
26 resources::OutputFormatter& formatter) override;
27};
28
33 public:
34 std::string GetName() const { return "message-read"; }
35 std::string GetDescription() const { return "Read a specific message"; }
36 std::string GetUsage() const {
37 return "message-read --id <message_id> [--format <json|text>]";
38 }
39
40 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
41 return parser.RequireArgs({"id"});
42 }
43
44 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
45 resources::OutputFormatter& formatter) override;
46};
47
52 public:
53 std::string GetName() const { return "message-search"; }
54 std::string GetDescription() const {
55 return "Search messages by text content";
56 }
57 std::string GetUsage() const {
58 return "message-search --query <query> [--limit <limit>] [--format "
59 "<json|text>]";
60 }
61
62 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
63 return parser.RequireArgs({"query"});
64 }
65
66 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
67 resources::OutputFormatter& formatter) override;
68};
69
70} // namespace handlers
71} // namespace cli
72} // namespace yaze
73
74#endif // YAZE_SRC_CLI_HANDLERS_MESSAGE_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:24
Command handler for listing messages.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetName() const
Get the command name.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Command handler for reading messages.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetUsage() const
Get the command usage string.
std::string GetName() const
Get the command name.
Command handler for searching messages.
std::string GetName() const
Get the command name.
std::string GetUsage() const
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
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.
absl::Status RequireArgs(const std::vector< std::string > &required) const
Validate that required arguments are present.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.