]> git.ipfire.org Git - pakfire.git/commitdiff
cli: commands: Move flags to the end
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 15 Oct 2023 11:08:14 +0000 (11:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 15 Oct 2023 11:08:14 +0000 (11:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/lib/command.h
src/cli/pakfire-builder.c

index b10df1e4ccd961c944cdfc7783b986e16f35707f..5e1fc79f2d6812c738de8865dcc46a2b545bcb48 100644 (file)
@@ -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,
index 6b6348a90cd67584a63499554f3c75b8a3fdc545..3eb40b6315d2ae3b06d6688ed38c5eda2c2e2a7d 100644 (file)
@@ -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 },