Browse Source

r.reclass: Print messages to stderr

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61160 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 11 years ago
parent
commit
1e92e6b862
2 changed files with 10 additions and 10 deletions
  1. 4 4
      raster/r.reclass/main.c
  2. 6 6
      raster/r.reclass/parse.c

+ 4 - 4
raster/r.reclass/main.c

@@ -99,16 +99,16 @@ int main(int argc, char *argv[])
     any = 0;
 
     if (tty) {
-	fprintf(stdout,
+	fprintf(stderr,
 		_("Enter rule(s), \"end\" when done, \"help\" if you need it\n"));
 	if (map_type == FCELL_TYPE)
-	    fprintf(stdout, _("FCELL: Data range is %.7g to %.7g\n"),
+	    fprintf(stderr, _("FCELL: Data range is %.7g to %.7g\n"),
 		    (double)min, (double)max);
 	else if (map_type == DCELL_TYPE)
-	    fprintf(stdout, _("DCELL: Data range is %.15g to %.15g\n"),
+	    fprintf(stderr, _("DCELL: Data range is %.15g to %.15g\n"),
 		    (double)min, (double)max);
 	else
-	    fprintf(stdout, _("CELL: Data range is %ld to %ld\n"), (long)min,
+	    fprintf(stderr, _("CELL: Data range is %ld to %ld\n"), (long)min,
 		    (long)max);
     }
 

+ 6 - 6
raster/r.reclass/parse.c

@@ -38,11 +38,11 @@ int parse(const char *line, RULE ** rules, RULE ** tail, struct Categories *cats
 	case 0:
 	    save = cur;
 	    if (!strncmp(cur, "help", 4)) {	/* help text */
-		fprintf(stdout, _("Enter a rule in one of these formats:\n"));
-		fprintf(stdout, "1 3 5      = 1   %s\n", _("poor quality"));
-		fprintf(stdout, "1 thru 10  = 1\n");
-		fprintf(stdout, "20 thru 50 = 2   %s\n", _("medium quality"));
-		fprintf(stdout, "*          = NULL\n");
+		fprintf(stderr, _("Enter a rule in one of these formats:\n"));
+		fprintf(stderr, "1 3 5      = 1   %s\n", _("poor quality"));
+		fprintf(stderr, "1 thru 10  = 1\n");
+		fprintf(stderr, "20 thru 50 = 2   %s\n", _("medium quality"));
+		fprintf(stderr, "*          = NULL\n");
 		state = 0;
 		cur += 4;
 		continue;
@@ -193,7 +193,7 @@ static int scan_value(CELL * v)
 	*v = sign * (CELL) fv;
 
 	if (dec && state)
-	    fprintf(stdout, _("%f rounded up to %d\n"), sign * fv, *v);
+	    fprintf(stderr, _("%f rounded up to %d\n"), sign * fv, *v);
     }
 
     switch (*cur) {