if (r < 0)
return log_error_errno(r, "Failed to set columns to display: %m");
- table_set_header(table, arg_legend);
-
HASHMAP_FOREACH_KEY(v, k, names) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
return log_error_errno(r, "Failed to fill line: %m");
}
- if (arg_json_format_flags & (JSON_FORMAT_OFF|JSON_FORMAT_PRETTY|JSON_FORMAT_PRETTY_AUTO))
- (void) pager_open(arg_pager_flags);
-
- r = table_print_json(table, NULL, arg_json_format_flags);
- if (r < 0)
- return table_log_print_error(r);
-
- return 0;
+ return table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
}
static void print_subtree(const char *prefix, const char *path, char **l) {
_cleanup_(table_unrefp) Table *table = NULL;
int r;
- (void) pager_open(arg_pager_flags);
-
r = acquire_bus(&bus);
if (r < 0)
return r;
if (r < 0)
return table_log_sort_error(r);
- table_set_header(table, arg_legend);
-
- r = table_print_json(table, stdout, arg_json_format_flags);
+ r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
if (r < 0)
- return table_log_print_error(r);
+ return r;
}
if (arg_legend && (arg_json_format_flags & JSON_FORMAT_OFF)) {