[GRASS-SVN] r54981 - grass/trunk/vector/v.what
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 8 03:35:32 PST 2013
Author: martinl
Date: 2013-02-08 03:35:30 -0800 (Fri, 08 Feb 2013)
New Revision: 54981
Modified:
grass/trunk/vector/v.what/what.c
Log:
v.what: print Map/Mapset even nothing found
remove unused notty
Modified: grass/trunk/vector/v.what/what.c
===================================================================
--- grass/trunk/vector/v.what/what.c 2013-02-08 09:00:42 UTC (rev 54980)
+++ grass/trunk/vector/v.what/what.c 2013-02-08 11:35:30 UTC (rev 54981)
@@ -13,6 +13,7 @@
static int nlines = 50;
#define WDTH 5
+#define SEP "------------------------------------------------------------------"
static void F_generate(const char *drvname, const char *dbname,
const char *tblname, const char *key, int keyval,
@@ -110,7 +111,6 @@
char east_buf[40], north_buf[40];
double sq_meters, sqm_to_sqft, acres, hectares, sq_miles;
double z, l;
- int notty = 0;
int getz;
struct field_info *Fi;
plus_t line, area, centroid;
@@ -176,9 +176,6 @@
fprintf(stdout, "East: %s\nNorth: %s\n", east_buf,
north_buf);
}
- if (notty)
- fprintf(stderr, "East: %s\nNorth: %s\n", east_buf,
- north_buf);
}
nlines++;
}
@@ -187,26 +184,21 @@
if ((str = strchr(buf, '@')))
*str = 0;
- if (line + area > 0 || G_verbose() >= G_verbose_std()) {
- if (script) {
- fprintf(stdout, "\nMap=%s\nMapset=%s\n", Map[i].name,
- Map[i].mapset);
- }
- else {
- fprintf(stdout, "\nMap: %s \nMapset: %s\n", Map[i].name,
- Map[i].mapset);
- }
- if (notty)
- fprintf(stderr, "\nMap: %s \nMapset: %s\n", Map[i].name,
- Map[i].mapset);
+ if (script) {
+ fprintf(stdout, "\nMap=%s\nMapset=%s\n", Map[i].name,
+ Map[i].mapset);
}
+ else {
+ fprintf(stdout, "%s", SEP);
+ fprintf(stdout, "\nMap: %s \nMapset: %s\n", Map[i].name,
+ Map[i].mapset);
+ }
+
nlines++;
if (line + area == 0) {
- if (G_verbose() >= G_verbose_std()) {
+ if (!script) {
fprintf(stdout, _("Nothing Found.\n"));
- if (notty)
- fprintf(stderr, _("Nothing Found.\n"));
}
nlines++;
continue;
@@ -451,14 +443,6 @@
fprintf(stdout, _("Acres: %.3f\nSq Miles: %.4f\n"),
acres, sq_miles);
}
- if (notty) {
- fprintf(stderr,
- _("Sq Meters: %.3f\nHectares: %.3f\n"),
- sq_meters, hectares);
- fprintf(stderr,
- _("Acres: %.3f\nSq Miles: %.4f\n"),
- acres, sq_miles);
- }
nlines += 3;
}
centroid = Vect_get_area_centroid(&Map[i], area);
More information about the grass-commit
mailing list