From 4a7a683d71b7ad5ace6e9d87c84237b1124f4bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 26 Aug 2026 10:16:01 +0200 Subject: [PATCH] udevadm-settle: use common verb help and add --introspect-cli The custom help() is replaced by the common verb help, which derives the synopsis, abstract, and option list from the verb declaration in udevadm.c and the "udevadm-settle" option namespace. --- src/udev/udevadm-settle.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 4398f40e72..dfd00e4b0d 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -8,13 +8,12 @@ #include "sd-bus.h" #include "sd-event.h" +#include "sd-json.h" #include "sd-login.h" #include "sd-messages.h" #include "alloc-util.h" #include "bus-util.h" -#include "format-table.h" -#include "help-util.h" #include "options.h" #include "path-util.h" #include "string-util.h" @@ -24,30 +23,12 @@ #include "udevadm.h" #include "udevadm-util.h" #include "unit-def.h" +#include "verbs.h" #include "virt.h" static usec_t arg_timeout_usec = 120 * USEC_PER_SEC; static const char *arg_exists = NULL; -static int help(void) { - _cleanup_(table_unrefp) Table *options = NULL; - int r; - - r = option_parser_get_help_table_ns("udevadm-settle", &options); - if (r < 0) - return r; - - help_cmdline("settle [OPTIONS]"); - help_abstract("Wait for pending udev events."); - help_section("Options"); - r = table_print_or_warn(options); - if (r < 0) - return r; - - help_man_page_reference("udevadm", "8"); - return 0; -} - static int parse_argv(int argc, char *argv[]) { int r; @@ -62,7 +43,7 @@ static int parse_argv(int argc, char *argv[]) { OPTION_NAMESPACE("udevadm-settle"): {} OPTION_COMMON_HELP: - return help(); + return command_print_verb_help("settle"); OPTION('V', "version", NULL, "Show package version"): return print_version(); @@ -86,6 +67,9 @@ static int parse_argv(int argc, char *argv[]) { return log_info_errno(SYNTHETIC_ERRNO(EINVAL), "Option -%c no longer supported.", opts.opt->short_code); + + OPTION_COMMON_INTROSPECT_CLI: + return introspect_cli(SD_JSON_FORMAT_OFF); } if (option_parser_get_n_args(&opts) > 0)