Browse Source

g.mlist: add extra message when listing maps

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48814 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
c98f73f795
1 changed files with 11 additions and 2 deletions
  1. 11 2
      general/g.mlist/main.c

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

@@ -248,12 +248,19 @@ static void make_list(
     if (!list)
 	return;
 
+    if (count > 0) {
+	if (any)
+	    fprintf(stdout, "\n");
+	G_message(_("%s available in mapset <%s>:"),
+		  elem->text, mapset);
+    }
+    
     for (i = 0; i < count; i++) {
 	char *name = list[i];
 
-	if (any)
+	if (any && i != 0)
 	    fprintf(stdout, "%s", separator);
-
+	
 	if (add_type)
 	    fprintf(stdout, "%s/", alias);
 
@@ -267,6 +274,8 @@ static void make_list(
 	any++;
     }
 
+    fflush(stdout);
+    
     G_free(list);
 }