Allow full expansion of AOS messages
The -pretty flag in aos_dump is intended to unwrap AOS messages to
one field per line, but doesn’t fully do so for all messages. Add
a flag to force unwrapping to one field per line.
Change-Id: I9cab18d1fc4a67c50d7ca06b35c69f63b39c5041
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/aos_dump.cc b/aos/aos_dump.cc
index 1662b47..a13ad9a 100644
--- a/aos/aos_dump.cc
+++ b/aos/aos_dump.cc
@@ -14,6 +14,9 @@
"If true, fetch the current message on the channel first");
DEFINE_bool(pretty, false,
"If true, pretty print the messages on multiple lines");
+DEFINE_bool(
+ pretty_max, false,
+ "If true, expand every field to its own line (expands more than -pretty)");
DEFINE_bool(print_timestamps, true, "If true, timestamps are printed.");
DEFINE_uint64(count, 0,
"If >0, aos_dump will exit after printing this many messages.");
@@ -44,7 +47,8 @@
aos::FlatbufferToJson(
builder, channel->schema(), static_cast<const uint8_t *>(context.data),
- {FLAGS_pretty, static_cast<size_t>(FLAGS_max_vector_size)});
+ {FLAGS_pretty, static_cast<size_t>(FLAGS_max_vector_size),
+ FLAGS_pretty_max});
if (FLAGS_print_timestamps) {
if (context.monotonic_remote_time != context.monotonic_event_time) {