[GRASS-SVN] r37233 - grass/branches/develbranch_6/general/g.version
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 14 06:39:36 EDT 2009
Author: hamish
Date: 2009-05-14 06:39:36 -0400 (Thu, 14 May 2009)
New Revision: 37233
Modified:
grass/branches/develbranch_6/general/g.version/main.c
Log:
new flag to output gis.h version (merge from trunk)
Modified: grass/branches/develbranch_6/general/g.version/main.c
===================================================================
--- grass/branches/develbranch_6/general/g.version/main.c 2009-05-14 08:57:21 UTC (rev 37232)
+++ grass/branches/develbranch_6/general/g.version/main.c 2009-05-14 10:39:36 UTC (rev 37233)
@@ -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 (argc > 1 && 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