shared/verbs: drop unused variable

Also add a note that the function does not support multiple groups. I
think that's fair, it doesn't make sense to generalize the functionality
when we're unlikely to ever use that. (Verb options are only used by
udevadm right now.)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-08-28 14:50:10 +02:00
parent 05fb4c6e27
commit 52c063713e
2 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -525,7 +525,6 @@ int options_get_help_table_group(
int r;
assert(ret);
assert(ret_group);
_cleanup_(table_unrefp) Table *table = NULL;
@@ -594,7 +593,8 @@ int options_get_help_table_group(
}
*ret = TAKE_PTR(table);
*ret_group = group;
if (ret_group)
*ret_group = group;
assert(opt - options < INT_MAX);
return opt - options;
+7 -2
View File
@@ -641,11 +641,16 @@ int _command_print_verb_help(
"Option namespace %s not found.", verb->option_namespace);
_cleanup_(table_unrefp) Table *table = NULL;
const char *group;
r = options_get_help_table_group(optns, options_end, /* option_groups= */ NULL, &table, &group);
r = options_get_help_table_group(
optns, options_end,
/* option_groups= */ NULL,
&table,
/* ret_group= */ NULL);
if (r < 0)
return r;
/* Note: we assume that only one option group is used for a verb. If this ever
* stops being true, the code here would need to be adjusted to loop over groups. */
help_section("Options");
r = table_print_or_warn(table);
if (r < 0)