shared/verbs: stop requiring an explicit program name

Almost all programs are simple and have only a single command. When
printing options, let's just use the first COMMAND block found by default.
This means we can drop the explicit program-name argument and reduce
copy&paste boilerplate.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-08-24 13:45:07 +02:00
parent ac80a8f4f3
commit 1cf40c9c72
112 changed files with 161 additions and 160 deletions
+2 -2
View File
@@ -2379,7 +2379,7 @@ static int attach_luks_or_plain_or_bitlk(
return attach_luks_or_plain_or_bitlk_by_passphrase(cd, name, passwords, flags, pass_volume_key);
}
VERB_COMMON_HELP_AUTO_HIDDEN("systemd-cryptsetup");
VERB_COMMON_HELP_AUTO_HIDDEN();
static int parse_argv(int argc, char *argv[], char ***ret_args) {
assert(argc >= 0);
@@ -2392,7 +2392,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
switch (c) {
OPTION_COMMON_HELP:
return command_print_help("systemd-cryptsetup");
return command_print_help();
OPTION_COMMON_VERSION:
return version();