[GRASS-SVN] r71715 - grass/branches/releasebranch_7_2/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 12 12:03:04 PST 2017


Author: neteler
Date: 2017-11-12 12:03:04 -0800 (Sun, 12 Nov 2017)
New Revision: 71715

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

Modified: grass/branches/releasebranch_7_2/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_2/lib/init/grass.py	2017-11-12 20:02:07 UTC (rev 71714)
+++ grass/branches/releasebranch_7_2/lib/init/grass.py	2017-11-12 20:03:04 UTC (rev 71715)
@@ -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"),
@@ -1626,7 +1626,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':
@@ -1650,6 +1650,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