[GRASS-SVN] r71712 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 12 12:00:22 PST 2017


Author: neteler
Date: 2017-11-12 12:00:22 -0800 (Sun, 12 Nov 2017)
New Revision: 71712

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass startup script: added version output 'grass75 --config version'

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2017-11-12 19:52:03 UTC (rev 71711)
+++ grass/trunk/lib/init/grass.py	2017-11-12 20:00:22 UTC (rev 71712)
@@ -343,7 +343,7 @@
     gui=_("use $DEFAULT_GUI graphical user interface"),
     gui_detail=_("and set as default"),
     config=_("print GRASS configuration parameters"),
-    config_detail=_("options: arch,build,compiler,path,revision"),
+    config_detail=_("options: arch,build,compiler,path,revision,version"),
     params=_("Parameters"),
     gisdbase=_("initial GRASS GIS database directory"),
     gisdbase_detail=_("directory containing Locations"),
@@ -1642,7 +1642,7 @@
 
     params = sys.argv[2:]
     if not params:
-        params = ['arch', 'build', 'compiler', 'path', 'revision']
+        params = ['arch', 'build', 'compiler', 'path', 'revision', 'version']
 
     for arg in params:
         if arg == 'path':
@@ -1666,6 +1666,8 @@
             val = grep('#define GIS_H_VERSION', linesrev)
             filerev.close()
             sys.stdout.write("%s\n" % val[0].split(':')[1].rstrip('$"\n').strip())
+        elif arg == 'version':
+			sys.stdout.write("%s\n" % grass_version)
         else:
             message(_("Parameter <%s> not supported") % arg)
 



More information about the grass-commit mailing list