[GRASS-SVN] r71713 - grass/branches/releasebranch_7_4/lib/init

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


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

Modified:
   grass/branches/releasebranch_7_4/lib/init/grass.py
Log:
grass startup script: added version output 'grass74 --config version'

Modified: grass/branches/releasebranch_7_4/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_4/lib/init/grass.py	2017-11-12 20:00:22 UTC (rev 71712)
+++ grass/branches/releasebranch_7_4/lib/init/grass.py	2017-11-12 20:00:48 UTC (rev 71713)
@@ -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