From 6a5d558a837c4a147a090e16c585f9fb6a3fd61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Tue, 9 Apr 2024 13:22:09 +0200 Subject: [PATCH] fbcli: Allow to override app-id Useful for testing --- cli/fbcli.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/fbcli.c b/cli/fbcli.c index 89571e5..a6dc3f8 100644 --- a/cli/fbcli.c +++ b/cli/fbcli.c @@ -130,7 +130,8 @@ main (int argc, char *argv[0]) { g_autoptr(GOptionContext) opt_context = NULL; g_autoptr(GError) err = NULL; - g_autofree gchar *profile = NULL; + g_autofree char *profile = NULL; + g_autofree char *app_id = NULL; const char *name = NULL; gboolean success; int watch = 30; @@ -144,6 +145,8 @@ main (int argc, char *argv[0]) "Profile name to set", NULL}, {"watch", 'w', 0, G_OPTION_ARG_INT, &watch, "How long to watch for feedback longest", NULL}, + {"app-id", 'A', 0, G_OPTION_ARG_STRING, &app_id, + "Override used application id"}, { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; @@ -155,7 +158,10 @@ main (int argc, char *argv[0]) return 1; } - if (!lfb_init ("org.sigxcpu.fbcli", &err)) { + if (!app_id) + app_id = g_strdup ("org.sigxcpu.fbcli"); + + if (!lfb_init (app_id, &err)) { g_print ("Failed to init libfeedback: %s\n", err->message); return 1; }