瀏覽代碼

new flag to output gis.h version

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37158 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 年之前
父節點
當前提交
b3ce38cfbb
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      general/g.version/main.c

+ 11 - 2
general/g.version/main.c

@@ -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 @@ int main(int argc, char *argv[])
     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 @@ int main(int argc, char *argv[])
 	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);
 }