[X2Go-Commits] [nx-libs] 01/30: nxagent: Add -version cmdline option.

git-admin at x2go.org git-admin at x2go.org
Tue Feb 27 09:51:48 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 7c32938ac5b803a1630920dd027be33df07aa3df
Author: Simon Matter <simon.matter at invoca.ch>
Date:   Wed Feb 21 23:39:23 2018 +0100

    nxagent: Add -version cmdline option.
    
    Fixes ArcticaProject/nx-libs#653.
---
 nx-X11/programs/Xserver/hw/nxagent/Args.c        | 11 +++++++++++
 nx-X11/programs/Xserver/hw/nxagent/Args.h        |  2 ++
 nx-X11/programs/Xserver/hw/nxagent/Init.c        |  5 +----
 nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 |  3 +++
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 604b331..1a43f37 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -336,6 +336,12 @@ int ddxProcessArgument(int argc, char *argv[], int i)
     return 0;
   }
 
+  if (!strcmp(argv[i], "-version"))
+  {
+    nxagentShowVersionInfo();
+    exit(0);
+  }
+
   /*
    * This had to be '-options' since the beginning
    * but was '-option' by mistake. Now we have to
@@ -2112,6 +2118,7 @@ void ddxUseMsg()
   ErrorF("-R                     enable rootless mode\n");
   ErrorF("-S                     enable shadow mode\n");
   ErrorF("-B                     enable proxy binding mode\n");
+  ErrorF("-version               show version information and exit\n");
 }
 
 static int nxagentGetDialogName()
@@ -2609,3 +2616,7 @@ void nxagentSetCoalescence()
   nxagentChangeOption(DisplayCoalescence, timeout);
 }
 
+void nxagentShowVersionInfo(void)
+{
+    ErrorF("NXAGENT - Version " NX_VERSION_CURRENT_STRING "\n");
+}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h
index a3f7e34..8d6f29b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h
@@ -96,6 +96,8 @@ void nxagentSetBufferSize(void);
 void nxagentSetScheduler(void);
 void nxagentSetCoalescence(void);
 
+void nxagentShowVersionInfo(void);
+
 extern int nxagentUserDefinedFontPath;
 
 extern int nxagentRemoteMajor;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c
index a35e3d5..17c430d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Init.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c
@@ -85,9 +85,6 @@ is" without express or implied warranty.
 #undef  DEBUG
 #undef  DUMP
 
-#define NXAGENT_VERSION NX_VERSION_CURRENT
-#define NXAGENT_VERSION_STRING NX_VERSION_CURRENT_STRING
-
 /*
  * ProcVector array defined in tables.c.
  */
@@ -234,7 +231,7 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
 
   if (serverGeneration <= 1)
   {
-    fprintf(stderr, "\nNXAGENT - Version " NXAGENT_VERSION_STRING "\n\n");
+    fprintf(stderr, "\nNXAGENT - Version " NX_VERSION_CURRENT_STRING "\n\n");
     fprintf(stderr, "Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com)\n");
     fprintf(stderr, "Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>\n");
     fprintf(stderr, "Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel at das-netzwerkteam.de>\n");
diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
index d06cb84..f4a9fa4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
+++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
@@ -449,6 +449,9 @@ enable shadow mode
 .B \-B
 enable proxy binding mode
 .TP 8
+.B \-version
+show version information and exit
+.TP 8
 .B \-options \fIfilename\fP
 path to an options file containing nx/nx options (see below).
 .PP

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list