]> git.ipfire.org Git - pakfire.git/commitdiff
cli: Pass argp state to the parse callback
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Oct 2023 21:14:13 +0000 (21:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Oct 2023 21:14:13 +0000 (21:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 files changed:
src/cli/lib/build.c
src/cli/lib/command.c
src/cli/lib/command.h
src/cli/lib/dist.c
src/cli/lib/image_create.c
src/cli/lib/info.c
src/cli/lib/provides.c
src/cli/lib/repo_compose.c
src/cli/lib/requires.c
src/cli/lib/search.c
src/cli/lib/shell.c
src/cli/lib/upload_create.c
src/cli/pakfire-builder.c
src/cli/pakfire-client.c
src/cli/pakfire.c

index afd9531b2da6eecfe43a03d44b0a6d544ab84e21..59b559a46346b521dc6632e3daa74572d5f01649 100644 (file)
@@ -62,7 +62,7 @@ static struct argp_option options[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 3adf0365fc3fe561fd75706be76f4d300e2d224a..f224ab7f93d651dae7c1625b8376b279fe7bb292 100644 (file)
@@ -99,7 +99,7 @@ static error_t __command_parse(int key, char* arg, struct argp_state* state) {
                if (!ctx->parse)
                        return ARGP_ERR_UNKNOWN;
 
-               return ctx->parse(key, arg, ctx->data);
+               return ctx->parse(key, arg, state, ctx->data);
        }
 
        switch (key) {
@@ -155,7 +155,7 @@ static error_t __command_parse(int key, char* arg, struct argp_state* state) {
                        if (!ctx->parse)
                                return ARGP_ERR_UNKNOWN;
 
-                       return ctx->parse(key, arg, ctx->data);
+                       return ctx->parse(key, arg, state, ctx->data);
        }
 
        return 0;
index 63a28baca4e2d37773e29b581467cf6e2d9b86b5..c03e34fffc824ab0c8d05493dd753072f682eb5d 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <argp.h>
 
-typedef error_t (*command_parse)(int key, char* arg, void* data);
+typedef error_t (*command_parse)(int key, char* arg, struct argp_state* state, void* data);
 
 struct command {
        const char* verb;
index e4bf955c0e6b1a544f52e6741b2f996bb0a6bd54..5e1cad1af916490ac99985280c3689f55844ae84 100644 (file)
@@ -41,7 +41,7 @@ struct config {
        unsigned int num_makefiles;
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 595848b18b4d9a035f9367178ed276ce67b5f909..cc2eb19d43a179bb255c8dfb9e40708194928423 100644 (file)
@@ -36,7 +36,7 @@ static const char* args_doc = "image create TYPE PATH";
 
 static const char* doc = "Creates images";
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 75316f38585b04fdc7298318d4bf023f140499cf..58a016d758625aeb7c1965d112d16f6bb3226a07 100644 (file)
@@ -54,7 +54,7 @@ static struct argp_option options[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 0e625b20e747b20f460ac0e0f0a2cf0e768ab31e..60589375570734910763cbfca11a05f8bdc917f8 100644 (file)
@@ -38,7 +38,7 @@ struct config {
        unsigned int num_patterns;
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index cccee66667af3feabc6816d2843aa4d693985594..47cff9b8bed53576d95e55dbdbd8074ac000c902 100644 (file)
@@ -50,7 +50,7 @@ static struct argp_option options[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 5b0703399203619356a1bd10b62e7f64934043e8..84b9580228318a599245f5deed45fb4d0c3a07a3 100644 (file)
@@ -38,7 +38,7 @@ struct config {
        unsigned int num_patterns;
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 840ec2ebb96f005ef20e997402fb23e81685a374..fa7fe810af5a0e24533c8174280942e353a727f9 100644 (file)
@@ -38,7 +38,7 @@ struct config {
        unsigned int num_patterns;
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 94c1e5b22237baedeb2874476c19e01a3d78028b..7ad2d971a993ebb58d0aaa439976da0ccf22874c 100644 (file)
@@ -51,7 +51,7 @@ static struct argp_option options[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index fc0309b3ac88a0f0950946d853205a6219f3f1b0..f22c7ad0c01eca011d71d7602479909488d7f600 100644 (file)
@@ -37,7 +37,7 @@ struct config {
        unsigned int num_files;
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct config* config = data;
 
        switch (key) {
index 96cc6a3607bd6e67a953294ef864e4d69e23c187..75fb65a42b637cb63742150099d50b34778533db 100644 (file)
@@ -93,7 +93,7 @@ const char* args_doc =
        "shell [OPTIONS...]\n"
        "search [OPTIONS...] PATTERN";
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct cli_config* config = data;
 
        switch (key) {
index 59877d735f9c6c11425605ca26fde986ded55f20..c39c643e1916ca98a9ae58254d58b8af5403b27f 100644 (file)
@@ -48,7 +48,7 @@ static struct argp_option options[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct pakfire_ctx* ctx = data;
 
        switch (key) {
index cb499ce1369ccfb9c67c1237316f7e576ebf3d4f..c1124cae9f9e9a94e4bd1a769780024fe13b9644 100644 (file)
@@ -88,7 +88,7 @@ static const struct command commands[] = {
        { NULL },
 };
 
-static error_t parse(int key, char* arg, void* data) {
+static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
        struct cli_config* config = data;
 
        switch (key) {