[Frugalware-git] frugalwareutils: mouseconfig: added --version and --help switches

Miklos Vajna vmiklos at frugalware.org
Mon Nov 5 16:01:10 CET 2007


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalwareutils.git;a=commitdiff;h=da86f4bcc08bf4be7738a90572e4fd25a8d0a53d

commit da86f4bcc08bf4be7738a90572e4fd25a8d0a53d
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Mon Nov 5 15:30:23 2007 +0100

mouseconfig: added --version and --help switches

diff --git a/mouseconfig/Makefile b/mouseconfig/Makefile
index a5e4484..add4c08 100644
--- a/mouseconfig/Makefile
+++ b/mouseconfig/Makefile
@@ -17,7 +17,7 @@
#

-include ../config.mak
-CFLAGS = $(LIB_CFLAGS)
+CFLAGS = $(LIB_CFLAGS) -DVERSION="\"$(VERSION)\""
LDFLAGS=-ldialog -lcurses -lm
CFLAGS += $(shell pkg-config --cflags glib-2.0)
LDFLAGS += $(shell pkg-config --libs glib-2.0)
diff --git a/mouseconfig/mouseconfig.c b/mouseconfig/mouseconfig.c
index 8d0d7b3..e13c9d0 100644
--- a/mouseconfig/mouseconfig.c
+++ b/mouseconfig/mouseconfig.c
@@ -94,6 +94,20 @@ int run(int argc, char **argv)

char *mouse_type=NULL, *mtype=NULL, *link=NULL;

+	if(argc > 1)
+	{
+		if(!strcmp(argv[1], "--help"))
+		{
+			system("man mouseconfig");
+			return(0);
+		}
+		else if(!strcmp(argv[1], "--version"))
+		{
+			printf("%s %s\n", argv[0], VERSION);
+			return(0);
+		}
+	}
+
fwutil_i18ninit(__FILE__);
if(argv!=NULL)
init_dialog(input, dialog_state.output);


More information about the Frugalware-git mailing list