diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index cb8df2972..380c9c849 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "xwayland-screen.h" #include "xwayland-vidmode.h" @@ -89,6 +90,7 @@ ddxUseMsg(void) ErrorF("-listenfd fd add given fd as a listen socket\n"); ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n"); ErrorF("-eglstream use eglstream backend for nvidia GPUs\n"); + ErrorF("-version show the server version and exit\n"); } static int init_fd = -1; @@ -96,6 +98,17 @@ static int wm_fd = -1; static int listen_fds[5] = { -1, -1, -1, -1, -1 }; static int listen_fd_count = 0; +static void +xwl_show_version(void) +{ + ErrorF("%s Xwayland %s (%d)\n", VENDOR_NAME, VENDOR_MAN_VERSION, VENDOR_RELEASE); + ErrorF("X Protocol Version %d, Revision %d\n", X_PROTOCOL, X_PROTOCOL_REVISION); +#if defined(BUILDERSTRING) + if (strlen(BUILDERSTRING)) + ErrorF("%s\n", BUILDERSTRING); +#endif +} + static void xwl_add_listen_fd(int argc, char *argv[], int i) { @@ -148,6 +161,10 @@ ddxProcessArgument(int argc, char *argv[], int i) else if (strcmp(argv[i], "-eglstream") == 0) { return 1; } + else if (strcmp(argv[i], "-version") == 0) { + xwl_show_version(); + exit(0); + } return 0; }