From deb6ed66a951fd0fe892a08cd4f3f802140229ce Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sat, 12 Jun 2004 22:29:39 +0200 Subject: Added -V option to synclient to display the version number. Suggested by Stefan Kombrink for use in the GUI configuration tool. --- Makefile | 2 +- synclient.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8085727..b0537a0 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ CCOPTIONS += $(call check_gcc,-fno-merge-constants,) CCOPTIONS += $(call check_gcc,-fno-pic,) CDEBUGFLAGS = -O2 CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) -DVERSION="\"$(VERSION)\"" -CFLAGSCLIENT = $(CDEBUGFLAGS) $(CCOPTIONS) -I$(X_INCLUDES_ROOT)/include +CFLAGSCLIENT = $(CDEBUGFLAGS) $(CCOPTIONS) -DVERSION="\"$(VERSION)\"" -I$(X_INCLUDES_ROOT)/include CC = gcc diff --git a/synclient.c b/synclient.c index d957b68..f094683 100644 --- a/synclient.c +++ b/synclient.c @@ -242,11 +242,12 @@ static void monitor(SynapticsSHM* synshm, int delay) static void usage() { - fprintf(stderr, "Usage: synclient [-m interval] [-h] [-l] [-?] [var1=value1 [var2=value2] ...]\n"); + fprintf(stderr, "Usage: synclient [-m interval] [-h] [-l] [-V] [-?] [var1=value1 [var2=value2] ...]\n"); fprintf(stderr, " -m monitor changes to the touchpad state.\n" " interval specifies how often (in ms) to poll the touchpad state\n"); fprintf(stderr, " -h Show detected hardware properties\n"); fprintf(stderr, " -l List current user settings\n"); + fprintf(stderr, " -V Print version number and exit\n"); fprintf(stderr, " -? Show this help message\n"); fprintf(stderr, " var=value Set user parameter 'var' to 'value'.\n"); exit(1); @@ -265,7 +266,7 @@ int main(int argc, char* argv[]) int first_cmd; /* Parse command line parameters */ - while ((c = getopt(argc, argv, "m:hl")) != -1) { + while ((c = getopt(argc, argv, "m:hlV")) != -1) { switch (c) { case 'm': do_monitor = 1; @@ -278,6 +279,9 @@ int main(int argc, char* argv[]) case 'l': dump_settings = 1; break; + case 'V': + printf("%s\n", VERSION); + exit(0); default: usage(); } -- cgit v1.2.3