]>
git.ipfire.org Git - people/ms/pakfire.git/blob - src/cli/pakfire-daemon.c
1 /*#############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2023 Pakfire development team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 #############################################################################*/
24 #include <pakfire/ctx.h>
26 #include "lib/client-build.h"
27 #include "lib/command.h"
28 #include "lib/config.h"
29 #include "lib/pakfire.h"
30 #include "lib/progressbar.h"
32 #include "lib/upload.h"
34 const char* argp_program_version
= PACKAGE_VERSION
;
36 static const char* doc
= "The Pakfire Build Daemon";
42 static struct argp_option options
[] = {
43 { "debug", OPT_DEBUG
, NULL
, 0, "Run in debug mode", 0 },
47 static error_t
parse(int key
, char* arg
, struct argp_state
* state
, void* data
) {
48 struct pakfire_ctx
* ctx
= data
;
52 pakfire_ctx_set_log_level(ctx
, LOG_DEBUG
);
56 return ARGP_ERR_UNKNOWN
;
62 int main(int argc
, char* argv
[]) {
63 struct pakfire_ctx
* ctx
= NULL
;
67 r
= pakfire_ctx_create(&ctx
, NULL
);
71 // Parse the command line and run any commands
72 r
= cli_parse(options
, NULL
, NULL
, doc
, parse
, argc
, argv
, ctx
);
80 pakfire_ctx_unref(ctx
);