pidgin/pidgin

Parents 4ad6f96d2aca
Children a8b8e1703239
The debug command line option does not actually take an argument.

Muscle memory from 10+ years ago had me launch pidgin with options '-dn', but this fails with an error:

$ ./build/pidgin/pidgin3 -dn
Missing argument for -d

Testing Done:
Launch with -d - see debug output and enabled accounts log in
Launch without -d - see no debug output (after realising DEBUG also needed to be undefined) and enabled accounts log in
Launch with -dn - see debug outout and no accounts log in

Reviewed at https://reviews.imfreedom.org/r/1393/
--- a/pidgin/pidginapplication.c Mon Apr 18 22:21:59 2022 -0500
+++ b/pidgin/pidginapplication.c Wed Apr 27 10:52:55 2022 -0500
@@ -61,21 +61,8 @@
/******************************************************************************
* Globals
*****************************************************************************/
-static gboolean
-pidgin_options_debug_cb(G_GNUC_UNUSED const gchar *option_name,
- G_GNUC_UNUSED const gchar *value,
- G_GNUC_UNUSED gpointer data,
- G_GNUC_UNUSED GError **error)
-{
- pidgin_debug_set_print_enabled(TRUE);
-
- return TRUE;
-}
-
-/******************************************************************************
- * Globals
- *****************************************************************************/
static gchar *opt_config_dir_arg = NULL;
+static gboolean opt_debug = FALSE;
static gboolean opt_nologin = FALSE;
static GOptionEntry option_entries[] = {
@@ -83,8 +70,7 @@
"config", 'c', 0, G_OPTION_ARG_FILENAME, &opt_config_dir_arg,
N_("use DIR for config files"), N_("DIR")
}, {
- "debug", 'd', 0, G_OPTION_ARG_CALLBACK,
- &pidgin_options_debug_cb,
+ "debug", 'd', 0, G_OPTION_ARG_NONE, &opt_debug,
N_("print debugging messages to stdout"), NULL
}, {
"nologin", 'n', 0, G_OPTION_ARG_NONE, &opt_nologin,
@@ -662,6 +648,8 @@
pidgin_debug_init_handler();
#ifdef DEBUG
pidgin_debug_set_print_enabled(TRUE);
+#else
+ pidgin_debug_set_print_enabled(opt_debug);
#endif
provider = gtk_css_provider_new();