Tools: dump: do not print metadata if the `-t` option is provided
Filesystem metadata are now dumped only when the user does not set
the `-t` command line option (which is used to dump filesystem
contents in tree format), in order to avoid polluting the dump
output with redundant information.
@@ -140,6 +140,7 @@ closure_function(3, 2, void, fsc,
exit(EXIT_FAILURE);
}
+ unsigned int options = bound(options);
u8 uuid[UUID_LEN];
filesystem_get_uuid(fs, uuid);
tuple root = filesystem_getroot(fs);
@@ -147,8 +148,10 @@ closure_function(3, 2, void, fsc,
bprintf(rb, "Label: %s\n", filesystem_get_label(fs));
bprintf(rb, "UUID: ");
print_uuid(rb, uuid);
+ if (!(options & DUMP_OPT_TREE)) {
bprintf(rb, "\nmetadata\n");
print_value(rb, root, timm("indent", "0"));
+ }
buffer_print(rb);
rprintf("\n");
deallocate_buffer(rb);
@@ -157,7 +160,6 @@ closure_function(3, 2, void, fsc,
if (b)
readdir(fs, h, root, b);
- unsigned int options = bound(options);
if (options & DUMP_OPT_TREE)
dump_fsentry(0, sym_this("/"), root);
