yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
message_commands.cc
Go to the documentation of this file.
2
3#include "absl/strings/str_format.h"
4
5namespace yaze {
6namespace cli {
7namespace handlers {
8
10 resources::OutputFormatter& formatter) {
11 auto limit = parser.GetInt("limit").value_or(50);
12
13 formatter.BeginObject("Message List");
14 formatter.AddField("limit", limit);
15 formatter.AddField("total_messages", 0);
16 formatter.AddField("status", "not_implemented");
17 formatter.AddField("message", "Message listing requires message system integration");
18
19 formatter.BeginArray("messages");
20 formatter.EndArray();
21 formatter.EndObject();
22
23 return absl::OkStatus();
24}
25
27 resources::OutputFormatter& formatter) {
28 auto message_id = parser.GetString("id").value();
29
30 formatter.BeginObject("Message");
31 formatter.AddField("message_id", message_id);
32 formatter.AddField("status", "not_implemented");
33 formatter.AddField("message", "Message reading requires message system integration");
34
35 formatter.BeginObject("content");
36 formatter.AddField("text", "Message content would appear here");
37 formatter.AddField("length", 0);
38 formatter.EndObject();
39 formatter.EndObject();
40
41 return absl::OkStatus();
42}
43
45 resources::OutputFormatter& formatter) {
46 auto query = parser.GetString("query").value();
47 auto limit = parser.GetInt("limit").value_or(10);
48
49 formatter.BeginObject("Message Search Results");
50 formatter.AddField("query", query);
51 formatter.AddField("limit", limit);
52 formatter.AddField("matches_found", 0);
53 formatter.AddField("status", "not_implemented");
54 formatter.AddField("message", "Message search requires message system integration");
55
56 formatter.BeginArray("matches");
57 formatter.EndArray();
58 formatter.EndObject();
59
60 return absl::OkStatus();
61}
62
63} // namespace handlers
64} // namespace cli
65} // namespace yaze
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
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.
std::optional< std::string > GetString(const std::string &name) const
Parse a named argument (e.g., –format=json or –format json)
absl::StatusOr< int > GetInt(const std::string &name) const
Parse an integer argument (supports hex with 0x prefix)
Utility for consistent output formatting across commands.
void BeginArray(const std::string &key)
Begin an array.
void BeginObject(const std::string &title="")
Start a JSON object or text section.
void EndObject()
End a JSON object or text section.
void AddField(const std::string &key, const std::string &value)
Add a key-value pair.
Main namespace for the application.