From ec964d79cba7d2c3bf1a248d615e9f6564200555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 16 Aug 2026 13:03:45 +0200 Subject: [PATCH] boot-check-no-failures: convert to VERB_COMMAND and add --introspect-cli The custom help() is replaced by a COMMAND() description, and --introspect-cli is added. --- src/bless-boot/boot-check-no-failures.c | 44 +++++-------------- .../units/TEST-74-AUX-UTILS.introspect-cli.sh | 1 + 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/bless-boot/boot-check-no-failures.c b/src/bless-boot/boot-check-no-failures.c index 9fa42a7ed6..a54bd62096 100644 --- a/src/bless-boot/boot-check-no-failures.c +++ b/src/bless-boot/boot-check-no-failures.c @@ -1,44 +1,19 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include - #include "sd-bus.h" +#include "sd-json.h" -#include "alloc-util.h" #include "build.h" #include "bus-error.h" -#include "format-table.h" #include "log.h" #include "main-func.h" -#include "options.h" -#include "pretty-print.h" +#include "verbs.h" -static int help(void) { - _cleanup_free_ char *link = NULL; - _cleanup_(table_unrefp) Table *options = NULL; - int r; - - r = terminal_urlify_man("systemd-boot-check-no-failures.service", "8", &link); - if (r < 0) - return log_oom(); - - r = option_parser_get_help_table(&options); - if (r < 0) - return r; - - printf("%s [OPTIONS...]\n" - "\n%sVerify system operational state.%s\n\n", - program_invocation_short_name, - ansi_highlight(), - ansi_normal()); - - r = table_print_or_warn(options); - if (r < 0) - return r; - - printf("\nSee the %s for details.\n", link); - return 0; -} +COMMAND( + "systemd-boot-check-no-failures\0", + "Verify system operational state.", + .man_pages = "systemd-boot-check-no-failures.service.8\0", +); static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); @@ -50,10 +25,13 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { OPTION_COMMON_HELP: - return help(); + return command_print_help("systemd-boot-check-no-failures"); OPTION_COMMON_VERSION: return version(); + + OPTION_COMMON_INTROSPECT_CLI: + return introspect_cli(SD_JSON_FORMAT_OFF); } return 1; diff --git a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh index 9c094de882..90d01b1779 100755 --- a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh +++ b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh @@ -19,6 +19,7 @@ INTROSPECTABLE=( systemd-backlight systemd-battery-check systemd-binfmt + systemd-boot-check-no-failures systemd-bsod systemd-cat systemd-cgls