Explorar o código

g.version: print svn revision in verbose mode

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40090 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=15) %!d(string=hai) anos
pai
achega
b4fa0e18ba
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  1. 8 4
      general/g.version/main.c

+ 8 - 4
general/g.version/main.c

@@ -59,10 +59,14 @@ int main(int argc, char *argv[])
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    if (strlen(GRASS_VERSION_SVN) > 0) {
-	fprintf(stdout, "GRASS %s (%s) - r%s\n",
-		GRASS_VERSION_NUMBER, GRASS_VERSION_DATE, 
-		GRASS_VERSION_SVN);
+    if (G_verbose() > G_verbose_std() && strlen(GRASS_VERSION_SVN) > 0) {
+	fprintf(stdout, "GRASS %s.%s (%s)\n",
+		GRASS_VERSION_NUMBER, GRASS_VERSION_SVN,
+		GRASS_VERSION_DATE);
+    }
+    else if (G_verbose() < G_verbose_std()) {
+	fprintf(stdout, "GRASS %s\n",
+		GRASS_VERSION_NUMBER);
     }
     else {
 	fprintf(stdout, "GRASS %s (%s) %s\n",