xwayland: Add version command line option
Xorg supports the '-version' command line option, add something similar to Xwayland. Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/976 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
parent
ee9f6e20de
commit
4709d24f8e
|
@ -37,6 +37,7 @@
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include <xserver_poll.h>
|
#include <xserver_poll.h>
|
||||||
#include <propertyst.h>
|
#include <propertyst.h>
|
||||||
|
#include <version-config.h>
|
||||||
|
|
||||||
#include "xwayland-screen.h"
|
#include "xwayland-screen.h"
|
||||||
#include "xwayland-vidmode.h"
|
#include "xwayland-vidmode.h"
|
||||||
|
@ -89,6 +90,7 @@ ddxUseMsg(void)
|
||||||
ErrorF("-listenfd fd add given fd as a listen socket\n");
|
ErrorF("-listenfd fd add given fd as a listen socket\n");
|
||||||
ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n");
|
ErrorF("-listen fd deprecated, use \"-listenfd\" instead\n");
|
||||||
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
|
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
|
||||||
|
ErrorF("-version show the server version and exit\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_fd = -1;
|
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_fds[5] = { -1, -1, -1, -1, -1 };
|
||||||
static int listen_fd_count = 0;
|
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
|
static void
|
||||||
xwl_add_listen_fd(int argc, char *argv[], int i)
|
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) {
|
else if (strcmp(argv[i], "-eglstream") == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-version") == 0) {
|
||||||
|
xwl_show_version();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue