]> git.mdlowis.com Git - proto/labwc.git/commitdiff
main: add feature flags to --version
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 28 Jun 2025 15:35:08 +0000 (17:35 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 28 Jun 2025 19:33:57 +0000 (20:33 +0100)
src/main.c

index e824123db17c83373b49459605a3fac844bbbab4..ef0931121116d788235b4ea3ffdb72a52a45d2e4 100644 (file)
@@ -52,6 +52,20 @@ usage(void)
        exit(0);
 }
 
+static void
+print_version(void)
+{
+       #define FEATURE_ENABLED(feature) (HAVE_##feature ? "+" : "-")
+       printf("labwc %s (%sxwayland %snls %srsvg %slibsfdo)\n",
+               LABWC_VERSION,
+               FEATURE_ENABLED(XWAYLAND),
+               FEATURE_ENABLED(NLS),
+               FEATURE_ENABLED(RSVG),
+               FEATURE_ENABLED(LIBSFDO)
+       );
+       #undef FEATURE_ENABLED
+}
+
 static void
 die_on_detecting_suid(void)
 {
@@ -175,7 +189,7 @@ main(int argc, char *argv[])
                        primary_client = optarg;
                        break;
                case 'v':
-                       printf("labwc " LABWC_VERSION "\n");
+                       print_version();
                        exit(0);
                case 'V':
                        verbosity = WLR_INFO;