]> git.ipfire.org Git - pakfire.git/commitdiff
cli: client: Add option to configure the distribution
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Oct 2023 11:25:04 +0000 (11:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Oct 2023 11:25:04 +0000 (11:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/pakfire-client.c

index 9ce6b76324fbb9e474cc1d18d992efbda0e72930..067882b884449e7a746fbd9af1ad51311724cd40 100644 (file)
@@ -44,11 +44,13 @@ static const char* args_doc =
 static const char* doc = "The Pakfire Build Service Client Tool";
 
 enum {
-       OPT_DEBUG = 1,
+       OPT_DEBUG  = 1,
+       OPT_DISTRO = 2,
 };
 
 static struct argp_option options[] = {
-       { "debug",        OPT_DEBUG,           NULL, 0, "Run in debug mode",           0 },
+       { "debug",  OPT_DEBUG,      NULL, 0, "Run in debug mode",       0 },
+       { "distro", OPT_DISTRO, "DISTRO", 0, "Choose the distribution", 0 },
        { NULL },
 };
 
@@ -60,6 +62,10 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
                        pakfire_ctx_set_log_level(config->ctx, LOG_DEBUG);
                        break;
 
+               case OPT_DISTRO:
+                       config->distro = arg;
+                       break;
+
                default:
                        return ARGP_ERR_UNKNOWN;
        }