[GRASS-SVN] r37158 - grass/trunk/general/g.version

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 11 04:50:34 EDT 2009


Author: hamish
Date: 2009-05-11 04:50:34 -0400 (Mon, 11 May 2009)
New Revision: 37158

Modified:
   grass/trunk/general/g.version/main.c
Log:
new flag to output gis.h version

Modified: grass/trunk/general/g.version/main.c
===================================================================
--- grass/trunk/general/g.version/main.c	2009-05-11 08:48:58 UTC (rev 37157)
+++ grass/trunk/general/g.version/main.c	2009-05-11 08:50:34 UTC (rev 37158)
@@ -7,7 +7,7 @@
 *  	    	Justin Hickey - Thailand - jhickey hpcc.nectec.or.th
 * PURPOSE: 	Output GRASS version number, date and copyright message.
 *             
-* COPYRIGHT:  	(C) 2000-2007 by the GRASS Development Team
+* COPYRIGHT:  	(C) 2000-2009 by the GRASS Development Team
 *
 *   	    	This program is free software under the GPL (>=v2)
 *   	    	Read the file COPYING that comes with GRASS for details.
@@ -26,7 +26,7 @@
 int main(int argc, char *argv[])
 {
     struct GModule *module;
-    struct Flag *copyright, *build;
+    struct Flag *copyright, *build, *gish_rev;
 
     G_gisinit(argv[0]);
 
@@ -42,6 +42,11 @@
     build->key = 'b';
     build->description = _("Print the GRASS build information");
 
+    gish_rev = G_define_flag();
+    gish_rev->key = 'r';
+    gish_rev->description =
+	_("Print the GIS library revision number and time");
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
@@ -61,5 +66,9 @@
 	fprintf(stdout, "\n");
     }
 
+    if (gish_rev->answer)
+	fprintf(stdout, "%s\n%s\n", GIS_H_VERSION, GIS_H_DATE);
+	/* use G_tokenize() if you want to get rid of the '$'s */
+
     return (EXIT_SUCCESS);
 }



More information about the grass-commit mailing list