From 252ca68fef6b8e002587ecd8b7791e11a076e588 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 27 Apr 2025 12:45:24 -0700 Subject: [PATCH] syndaemon: add -V option to print version Matches synclient -V Also updates man page to include missing -v option that was listed in the usage output. Signed-off-by: Alan Coopersmith Part-of: --- man/syndaemon.man | 14 +++++++++++--- tools/syndaemon.c | 8 ++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/man/syndaemon.man b/man/syndaemon.man index b3e3f03..37de1ea 100644 --- a/man/syndaemon.man +++ b/man/syndaemon.man @@ -1,14 +1,16 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SYNDAEMON __appmansuffix__ 2013-03-26 __vendorversion__ +.TH SYNDAEMON __appmansuffix__ 2025-04-27 __vendorversion__ .SH NAME syndaemon \- a program that monitors keyboard activity and disables the touchpad when the keyboard is being used. .SH "SYNOPSIS" .nf \fBsyndaemon\fP [\fB\-i\fP \fIidle\-time\fP] [\fB\-m\fP \fIpoll-inverval\fP] \ -[\fB\-d\fP] [\fB\-p\fP \fIpid\-file\fP] - [\fB\-t\fP] [\fB\-k\fP] [\fB\-K\fP] [\fB\-R\fP] +[\fB\-d\fP [\fB\-p\fP \fIpid\-file\fP]] + [\fB\-t\fP] [\fB\-k\fP] [\fB\-K\fP] [\fB\-R\fP] [\fB\-v\fP] + +\fBsyndaemon\fP [\fB\-V\fP|\fB\-?\fP] .fi .SH "DESCRIPTION" Disabling the touchpad while typing avoids unwanted movements of the @@ -48,6 +50,12 @@ Like \fB\-k\fP but also ignore Modifier+Key combos. Use the XRecord extension for detecting keyboard activity instead of polling the keyboard state. .TP +\fB\-v\fP +Print diagnostic messages. +.TP +\fB\-V\fP +Print version string and exit. +.TP \fB\-?\fP Show the help message. .SH "ENVIRONMENT VARIABLES" diff --git a/tools/syndaemon.c b/tools/syndaemon.c index 9c86a5c..6b55ef4 100644 --- a/tools/syndaemon.c +++ b/tools/syndaemon.c @@ -79,7 +79,7 @@ static void usage(void) { fprintf(stderr, - "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]\n"); + "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d [-p pid-file]] [-tkKRv] [-V]\n"); fprintf(stderr, " -i How many seconds to wait after the last key press before\n"); fprintf(stderr, " enabling the touchpad. (default is 2.0s)\n"); @@ -94,6 +94,7 @@ usage(void) fprintf(stderr, " -K Like -k but also ignore Modifier+Key combos.\n"); fprintf(stderr, " -R Use the XRecord extension.\n"); fprintf(stderr, " -v Print diagnostic messages.\n"); + fprintf(stderr, " -V Print version string and exit\n"); fprintf(stderr, " -? Show this help message.\n"); exit(1); } @@ -571,7 +572,7 @@ main(int argc, char *argv[]) int use_xrecord = 0; /* Parse command line parameters */ - while ((c = getopt(argc, argv, "i:m:dtp:kKR?v")) != EOF) { + while ((c = getopt(argc, argv, "i:m:dtp:kKR?vV")) != EOF) { switch (c) { case 'i': idle_time = atof(optarg); @@ -601,6 +602,9 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; + case 'V': + puts(VERSION); + exit(EXIT_SUCCESS); case '?': default: usage();