Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalwareutils.git;a=commitdiff;h=1c78509dc8816e7ef310bfcb899f2806247bb268
commit 1c78509dc8816e7ef310bfcb899f2806247bb268
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date: Mon Nov 5 15:56:29 2007 +0100
xconfig: added --help and --version switches
diff --git a/xconfig/Makefile b/xconfig/Makefile
index f71c632..a45e3ff 100644
--- a/xconfig/Makefile
+++ b/xconfig/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/xconfig/xconfig.c b/xconfig/xconfig.c
index 57c623e..82eac4e 100644
--- a/xconfig/xconfig.c
+++ b/xconfig/xconfig.c
@@ -38,16 +38,29 @@ int run(int argc, char **argv)
int needrelease, ret, silent=0;
fwutil_i18ninit(__FILE__);
- if(argc>1 && !strcmp(argv[1], "--live"))
+ if(argc > 1)
{
- if(argc!=4)
+ if(!strcmp(argv[1], "--live"))
{
- printf(_("usage: %s [--live <resolution> <depth>\n"),
argv[0]);
- return(1);
+ if(argc!=4)
+ {
+ printf(_("usage: %s [--live <resolution>
<depth>\n"), argv[0]);
+ return(1);
+ }
+ res = argv[2];
+ depth = argv[3];
+ silent=1;
+ }
+ else if(!strcmp(argv[1], "--help"))
+ {
+ system("man xconfig");
+ return(0);
+ }
+ else if(!strcmp(argv[1], "--version"))
+ {
+ printf("%s %s\n", argv[0], VERSION);
+ return(0);
}
- res = argv[2];
- depth = argv[3];
- silent=1;
}
init_dialog(input, dialog_state.output);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git