From: Lennart Poettering Date: Mon, 20 Nov 2023 13:50:56 +0000 (+0100) Subject: analyze: teach "capability" verb JSON output too X-Git-Tag: v256-rc1~1559^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81373a0e28214fe841cc6ec61697030ac7e699ee;p=thirdparty%2Fsystemd.git analyze: teach "capability" verb JSON output too --- diff --git a/src/analyze/analyze-capability.c b/src/analyze/analyze-capability.c index 8072175a847..7cdc0e3d929 100644 --- a/src/analyze/analyze-capability.c +++ b/src/analyze/analyze-capability.c @@ -46,11 +46,9 @@ int verb_capabilities(int argc, char *argv[], void *userdata) { (void) table_set_sort(table, (size_t) 1); } - pager_open(arg_pager_flags); - - r = table_print(table, NULL); + r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend); if (r < 0) - return r; + return log_error_errno(r, "Failed to output table: %m"); return EXIT_SUCCESS; } diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 7bbaf10567e..2c230e08199 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -558,9 +558,9 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Option --offline= is only supported for security right now."); - if (arg_json_format_flags != JSON_FORMAT_OFF && !STRPTR_IN_SET(argv[optind], "security", "inspect-elf", "plot", "fdstore", "pcrs", "architectures")) + if (arg_json_format_flags != JSON_FORMAT_OFF && !STRPTR_IN_SET(argv[optind], "security", "inspect-elf", "plot", "fdstore", "pcrs", "architectures", "capability")) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Option --json= is only supported for security, inspect-elf, plot, fdstore, pcrs, architectures right now."); + "Option --json= is only supported for security, inspect-elf, plot, fdstore, pcrs, architectures, capability right now."); if (arg_threshold != 100 && !streq_ptr(argv[optind], "security")) return log_error_errno(SYNTHETIC_ERRNO(EINVAL),