From: Michael Tremer Date: Sun, 15 Oct 2023 11:08:14 +0000 (+0000) Subject: cli: commands: Move flags to the end X-Git-Tag: 0.9.30~1518 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0cd8e0eb12f91e08369d7835aa19a5de97848e05;p=pakfire.git cli: commands: Move flags to the end Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/command.h b/src/cli/lib/command.h index b10df1e4c..5e1fc79f2 100644 --- a/src/cli/lib/command.h +++ b/src/cli/lib/command.h @@ -27,11 +27,11 @@ typedef error_t (*command_parse)(int key, char* arg, void* data); struct command { const char* verb; + int (*callback)(void* config, int argc, char* argv[]); enum { CLI_REQUIRE_ONE_ARGUMENT = (1 << 0), CLI_REQUIRE_ONE_OR_MORE_ARGUMENTS = (1 << 1), } flags; - int (*callback)(void* config, int argc, char* argv[]); }; int cli_parse(const struct argp_option* options, const struct command* commands, diff --git a/src/cli/pakfire-builder.c b/src/cli/pakfire-builder.c index 6b6348a90..3eb40b631 100644 --- a/src/cli/pakfire-builder.c +++ b/src/cli/pakfire-builder.c @@ -64,8 +64,8 @@ static struct argp_option options[] = { }; static const struct command commands[] = { - { "build", CLI_REQUIRE_ONE_OR_MORE_ARGUMENTS, cli_build }, - { "clean", 0, cli_clean }, + { "build", cli_build, 0 }, + { "clean", cli_clean, 0 }, #if 0 { "dist", 0, cli_dist }, { "image", 0, cli_image },