diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c index f1f40324de..45a1f52bd2 100644 --- a/src/udev/v4l_id/v4l_id.c +++ b/src/udev/v4l_id/v4l_id.c @@ -8,34 +8,25 @@ #include #include +#include "sd-json.h" + #include "build.h" #include "errno-util.h" #include "fd-util.h" -#include "format-table.h" -#include "help-util.h" #include "log.h" #include "main-func.h" -#include "options.h" #include "string-util.h" #include "strv.h" #include "utf8.h" +#include "verbs.h" static const char *arg_device = NULL; -static int help(void) { - _cleanup_(table_unrefp) Table *options = NULL; - int r; - - r = option_parser_get_help_table(&options); - if (r < 0) - return r; - - help_cmdline("[OPTIONS...] DEVICE"); - help_abstract("Video4Linux device identification."); - help_section("Options"); - - return table_print_or_warn(options); -} +COMMAND( + "v4l_id\0", + "Identify Video4Linux devices.", + .argspec = "DEVICE\0", +); static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); @@ -47,10 +38,13 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { OPTION_COMMON_HELP: - return help(); + return command_print_help("v4l_id"); OPTION_COMMON_VERSION: return version(); + + OPTION_COMMON_INTROSPECT_CLI: + return introspect_cli(SD_JSON_FORMAT_OFF); } char **args = option_parser_get_args(&opts); diff --git a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh index 34cc54269d..2ca370c8a1 100755 --- a/test/units/TEST-74-AUX-UTILS.introspect-cli.sh +++ b/test/units/TEST-74-AUX-UTILS.introspect-cli.sh @@ -109,6 +109,7 @@ INTROSPECTABLE=( timedatectl updatectl userdbctl + v4l_id varlinkctl )