#include <argp.h>
+#include <pakfire/buildservice.h>
+
#include "client-build.h"
#include "command.h"
-
-#include <pakfire/ctx.h>
-#include <pakfire/buildservice.h>
+#include "pakfire.h"
static const char* args_doc = "[OPTIONS...] MAKEFILES...";
char* upload = NULL;
int r;
- struct pakfire_ctx* ctx = data;
+ struct cli_config* cli_config = data;
// Parse the command line
r = cli_parse(options, NULL, args_doc, doc, parse, argc, argv, &config);
goto ERROR;
// Connect to the build service
- r = pakfire_buildservice_create(&service, ctx);
+ r = pakfire_buildservice_create(&service, cli_config->ctx);
if (r)
goto ERROR;
#include <argp.h>
#include <pakfire/buildservice.h>
-#include <pakfire/ctx.h>
#include "command.h"
+#include "pakfire.h"
#include "upload_create.h"
static const char* args_doc = "FILES...";
char* uuid = NULL;
int r;
- struct pakfire_ctx* ctx = data;
+ struct cli_config* cli_config = data;
// Parse the command line
r = cli_parse(NULL, NULL, args_doc, doc, parse, argc, argv, &config);
goto ERROR;
// Connect to the build service
- r = pakfire_buildservice_create(&service, ctx);
+ r = pakfire_buildservice_create(&service, cli_config->ctx);
if (r)
goto ERROR;
#include <argp.h>
#include <pakfire/buildservice.h>
-#include <pakfire/ctx.h>
#include <pakfire/util.h>
#include "command.h"
+#include "pakfire.h"
#include "upload_delete.h"
static const char* args_doc = "FILES...";
struct config config = {};
int r;
- struct pakfire_ctx* ctx = data;
+ struct cli_config* cli_config = data;
// Parse the command line
r = cli_parse(NULL, NULL, args_doc, doc, parse, argc, argv, &config);
goto ERROR;
// Connect to the build service
- r = pakfire_buildservice_create(&service, ctx);
+ r = pakfire_buildservice_create(&service, cli_config->ctx);
if (r)
goto ERROR;
#include <json.h>
#include <pakfire/buildservice.h>
-#include <pakfire/ctx.h>
#include "command.h"
#include "dump.h"
+#include "pakfire.h"
#include "upload_list.h"
static const char* doc = "Lists all uploads";
struct json_object* uploads = NULL;
int r;
- struct pakfire_ctx* ctx = data;
+ struct cli_config* cli_config = data;
// Parse the command line
r = cli_parse(NULL, NULL, NULL, doc, NULL, argc, argv, NULL);
goto ERROR;
// Connect to the build service
- r = pakfire_buildservice_create(&service, ctx);
+ r = pakfire_buildservice_create(&service, cli_config->ctx);
if (r)
goto ERROR;
#include "lib/client-build.h"
#include "lib/command.h"
+#include "lib/config.h"
+#include "lib/pakfire.h"
#include "lib/progressbar.h"
#include "lib/upload.h"
};
static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
- struct pakfire_ctx* ctx = data;
+ struct cli_config* config = data;
switch (key) {
case OPT_DEBUG:
- pakfire_ctx_set_log_level(ctx, LOG_DEBUG);
+ pakfire_ctx_set_log_level(config->ctx, LOG_DEBUG);
break;
default:
// Setup progress callback
pakfire_ctx_set_progress_callback(ctx, cli_setup_progressbar, NULL);
+ struct cli_config config = {
+ .ctx = ctx,
+ };
+
// Parse the command line and run any commands
- r = cli_parse(options, commands, args_doc, doc, parse, argc, argv, ctx);
+ r = cli_parse(options, commands, args_doc, doc, parse, argc, argv, &config);
ERROR:
if (ctx)