[GRASS-SVN] r37359 -
grass/branches/releasebranch_6_4/general/g.version
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri May 22 08:16:42 EDT 2009
Author: hamish
Date: 2009-05-22 08:16:42 -0400 (Fri, 22 May 2009)
New Revision: 37359
Modified:
grass/branches/releasebranch_6_4/general/g.version/main.c
Log:
new flag to output gis.h version (merge from trunk)
Modified: grass/branches/releasebranch_6_4/general/g.version/main.c
===================================================================
--- grass/branches/releasebranch_6_4/general/g.version/main.c 2009-05-22 11:39:22 UTC (rev 37358)
+++ grass/branches/releasebranch_6_4/general/g.version/main.c 2009-05-22 12:16:42 UTC (rev 37359)
@@ -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,14 @@
fprintf(stdout, "\n");
}
+ if (gish_rev->answer) {
+ /* fprintf(stdout, "%s\n%s\n", GIS_H_VERSION, GIS_H_DATE); */
+ char **rev_ver = G_tokenize(GIS_H_VERSION, "$");
+ char **rev_time = G_tokenize(GIS_H_DATE, "$");
+ fprintf(stdout, "%s\n%s\n", rev_ver[1], rev_time[1]);
+ G_free_tokens(rev_ver);
+ G_free_tokens(rev_time);
+ }
+
return (EXIT_SUCCESS);
}
More information about the grass-commit
mailing list