diff options
author | Peter Osterlund <petero2@telia.com> | 2004-06-12 22:29:39 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:02:29 +0200 |
commit | deb6ed66a951fd0fe892a08cd4f3f802140229ce (patch) | |
tree | 03d462ad659d1c984add9c5e3b788b014556fb68 | |
parent | ea9e8df12aec74d3e523d869323bbc6a9e44f74d (diff) |
Added -V option to synclient to display the version number.
Suggested by Stefan Kombrink <katakombi@web.de> for use in the GUI
configuration tool.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | synclient.c | 8 |
2 files changed, 7 insertions, 3 deletions
@@ -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(); } |