From: Zbigniew Jędrzejewski-Szmek Date: Fri, 6 Mar 2026 12:32:05 +0000 (+0100) Subject: pull: call all verb functions verb_* X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5eccdf20ac6ef1c9bdf03fb7c06c55aec99f6b77;p=thirdparty%2Fsystemd.git pull: call all verb functions verb_* --- diff --git a/src/import/pull.c b/src/import/pull.c index f8b90ad725a..e777d41ee69 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -117,7 +117,7 @@ static void on_tar_finished(TarPull *pull, int error, void *userdata) { sd_event_exit(event, ABS(error)); } -static int pull_tar(int argc, char *argv[], void *userdata) { +static int verb_pull_tar(int argc, char *argv[], void *userdata) { _cleanup_free_ char *ll = NULL, *normalized = NULL; _cleanup_(sd_event_unrefp) sd_event *event = NULL; _cleanup_(tar_pull_unrefp) TarPull *pull = NULL; @@ -187,7 +187,7 @@ static void on_raw_finished(RawPull *pull, int error, void *userdata) { sd_event_exit(event, ABS(error)); } -static int pull_raw(int argc, char *argv[], void *userdata) { +static int verb_pull_raw(int argc, char *argv[], void *userdata) { _cleanup_free_ char *ll = NULL, *normalized = NULL; _cleanup_(sd_event_unrefp) sd_event *event = NULL; _cleanup_(raw_pull_unrefp) RawPull *pull = NULL; @@ -256,7 +256,7 @@ static void on_oci_finished(OciPull *pull, int error, void *userdata) { sd_event_exit(event, ABS(error)); } -static int pull_oci(int argc, char *argv[], void *userdata) { +static int verb_pull_oci(int argc, char *argv[], void *userdata) { int r; const char *ref = argv[1]; @@ -311,8 +311,7 @@ static int pull_oci(int argc, char *argv[], void *userdata) { return -r; } -static int help(int argc, char *argv[], void *userdata) { - +static int help(void) { printf("%1$s [OPTIONS...] {COMMAND} ...\n" "\n%4$sDownload disk images.%5$s\n" "\n%2$sCommands:%3$s\n" @@ -357,8 +356,11 @@ static int help(int argc, char *argv[], void *userdata) { return 0; } -static int parse_argv(int argc, char *argv[]) { +static int verb_help(int argc, char *argv[], void *userdata) { + return help(); +} +static int parse_argv(int argc, char *argv[]) { enum { ARG_VERSION = 0x100, ARG_FORCE, @@ -418,7 +420,7 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { case 'h': - return help(0, NULL, NULL); + return help(); case ARG_VERSION: return version(); @@ -659,10 +661,10 @@ static void parse_env(void) { static int pull_main(int argc, char *argv[]) { static const Verb verbs[] = { - { "help", VERB_ANY, VERB_ANY, 0, help }, - { "tar", 2, 3, 0, pull_tar }, - { "raw", 2, 3, 0, pull_raw }, - { "oci", 2, 3, 0, pull_oci }, + { "help", VERB_ANY, VERB_ANY, 0, verb_help }, + { "tar", 2, 3, 0, verb_pull_tar }, + { "raw", 2, 3, 0, verb_pull_raw }, + { "oci", 2, 3, 0, verb_pull_oci }, {} };