From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:35:08 +0000 (+0200) Subject: main: add feature flags to --version X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ca01dcaa95f1cf482f3c8486e4c0d6c6ba1742ab;p=proto%2Flabwc.git main: add feature flags to --version --- diff --git a/src/main.c b/src/main.c index e824123d..ef093112 100644 --- a/src/main.c +++ b/src/main.c @@ -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;