Only print supported debug flags
authorMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:51:58 +0000 (21:51 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 22 Sep 2022 01:51:58 +0000 (21:51 -0400)
It is a bit disorienting to print a lot of unavailable
debug flags, with some working ones mixed in. Just show
the ones that work.

gdk/gdk.c

index 2550c0f294aff8cff81ae2670392c80d3343897b..2c145a0898f2c1dba14c79c43c16b1d11bd106c0 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -256,16 +256,12 @@ gdk_parse_debug_var (const char        *variable,
 
       fprintf (stderr, "Supported %s values:\n", variable);
       for (i = 0; i < nkeys; i++) {
-        fprintf (stderr, "  %s%*s%s", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
-        if (!debug_enabled && !keys[i].always_enabled)
-          fprintf (stderr, " [unavailable]");
-        fprintf (stderr, "\n");
+        if (debug_enabled || keys[i].always_enabled)
+          fprintf (stderr, "  %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
       }
       fprintf (stderr, "  %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
       fprintf (stderr, "  %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
       fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
-      if (!debug_enabled)
-        fprintf (stderr, "Values marked as [unavailable] are only accessible if GTK is built with G_ENABLE_DEBUG.\n");
     }
 
   if (invert)