Commit 4709d24f authored by Olivier Fourdan's avatar Olivier Fourdan

xwayland: Add version command line option

Xorg supports the '-version' command line option, add something similar
to Xwayland.

Closes: #976Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
parent ee9f6e20
......@@ -37,6 +37,7 @@
#include <os.h>
#include <xserver_poll.h>
#include <propertyst.h>
#include <version-config.h>
#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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment