ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

Patch to add version info to nxagent -help #653

Closed realsimix closed 6 years ago

realsimix commented 6 years ago

Attached small patch adds the version info to the output of nxagent -help:

$ nxagent -help 2>&1 | head -n 8
NXAGENT - Version 3.5.99.13

Usage: nxagent [<options>] [:<display>]
-a #                   mouse acceleration (pixels)
-ac                    disable access control restrictions
-audit int             set audit trail level
-auth file             select authorization file
bc                     enable bug compatibility

Would be nice if this could be added. nx-libs-3.6.x-20180124-nxagent_version.patch.txt

uli42 commented 6 years ago

Thank you! This also fixes #639.

However, why are you adding

+#define NXAGENT_VERSION_STRING NX_VERSION_CURRENT_STRING

instead of simply using NX_VERSION_CURRENT_STRING directly?

Also, please have a look at checkX2goAgent in hw/nxagent/Init.c. The help should also consider this check.

Please enclose your changes in #ifdef NXAGENT_SERVER. This simplyfies backports.

Finally while your are working at that it would be great if you could have a look at #606

realsimix commented 6 years ago

Thanks for your input!

I tried to improve it as suggested. Can you have a look at it now? nx-libs-3.6.x-20180124-nxagent_version.patch.txt

realsimix commented 6 years ago

While rethinking it, I'll create another version with nxagent -V to print version info.

realsimix commented 6 years ago

Attached patch does it:

$ nxagent -help
Usage: nxagent [<options>] [:<display>]

-a #                   mouse acceleration (pixels)
-ac                    disable access control restrictions
-audit int             set audit trail level
-auth file             select authorization file
...
-S                     enable shadow mode
-B                     enable proxy binding mode
-V                     print version information
-options file          file containing nx/nx options
$ nxagent -V
NXAGENT - Version 3.5.99.13

Tries to be consistent with nxproxy which uses nxproxy -v, manpage is also updated. nx-libs-3.6.x-20180124-nxagent_version.patch.txt

realsimix commented 6 years ago

Just a minor update because not all compilers liked it. nx-libs-3.6.x-20180124-nxagent_version.patch.txt

uli42 commented 6 years ago

Hi Simon,

sorry for being naggy, but as nxagent is derived from Xorg we want to stay as close as possible option-wise (this makes it easier to backport/upgrade). The X server on my Centos7 has a -version option. We should better adapt this instead of adding anther option. Besides, the capital letter options are selecting a mode nxagent should run in, so -V does not really fit in there...:

$ Xorg -version

X.Org X Server 1.19.3 Release Date: 2017-03-15 X Protocol Version 11, Revision 0 Build Operating System: 3.10.0-514.16.1.el7.x86_64 Current Operating System: Linux anubis 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-693.11.6.el7.x86_64 root=/dev/mapper/vg0-root ro crashkernel=auto rd.lvm.lv=vg0/root rd.lvm.lv=vg0/swap rhgb quiet nouveau.modeset=0 rd.driver.blacklist=nouveau plymouth.ignore-udev LANG=en_US.UTF-8 Build Date: 05 August 2017 06:19:43AM Build ID: xorg-x11-server 1.19.3-11.el7 Current version of pixman: 0.34.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.

We do not need all this information in the version output (yet), just the version is sufficient, I guess.

Uli

On Fri, Jan 26, 2018 at 8:03 AM, Simon Matter notifications@github.com wrote:

Attached patch does it:

$ nxagent -help Usage: nxagent [] [:]

-a # mouse acceleration (pixels) -ac disable access control restrictions -audit int set audit trail level -auth file select authorization file ... -S enable shadow mode -B enable proxy binding mode -V print version information -options file file containing nx/nx options

$ nxagent -V NXAGENT - Version 3.5.99.13

Tries to be consistent with nxproxy which uses nxproxy -v, manpage is also updated. nx-libs-3.6.x-20180124-nxagent_version.patch.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

realsimix commented 6 years ago

Hi Uli,

I've checked with Xnest - and of course it doesn't have the -version option :-) No problem, I'll update...

Regards, Simon

realsimix commented 6 years ago

I hope it's okay now: nx-libs-3.6.x-20180124-nxagent_version.patch.txt

sunweaver commented 6 years ago

Hi Simon,

On Friday, January 26, 2018, Simon Matter wrote:

I hope it's okay now: nx-libs-3.6.x-20180124-nxagent_version.patch.txt

I really think, we should get you into using PRs rather than attaching dozens patch variations to an open issue... Let me know if you are interested in a quick tutorial and I help you moving this bug into a PR.

Thanks+Greets Mike

-- Sent from my Fairphone 2 (running Sailfish OS)