[GRASS-SVN] r66983 - grass/trunk/raster3d/r3.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 29 12:49:41 PST 2015
Author: jachym
Date: 2015-11-29 12:49:41 -0800 (Sun, 29 Nov 2015)
New Revision: 66983
Modified:
grass/trunk/raster3d/r3.info/main.c
Log:
Adding more generic support for -g flag in r3.info
Modified: grass/trunk/raster3d/r3.info/main.c
===================================================================
--- grass/trunk/raster3d/r3.info/main.c 2015-11-29 14:12:38 UTC (rev 66982)
+++ grass/trunk/raster3d/r3.info/main.c 2015-11-29 20:49:41 UTC (rev 66983)
@@ -458,7 +458,7 @@
fprintf(out, "max=%f\n", dmax);
}
if (hflag->answer) {
- if (hist_ok) {
+ if (hist_ok && !gflag->answer) {
fprintf(out, "Title:\n");
fprintf(out, " %s\n", Rast_get_history(&hist, HIST_TITLE));
fprintf(out, "Data Source:\n");
@@ -472,6 +472,21 @@
fprintf(out, " %s\n", Rast_history_line(&hist, i));
}
}
+ else if (hist_ok && gflag->answer) {
+ fprintf(out, "title=");
+ fprintf(out, "\"%s\"\n", Rast_get_history(&hist, HIST_TITLE));
+ fprintf(out, "source1=");
+ fprintf(out, "\"%s\"\n", Rast_get_history(&hist, HIST_DATSRC_1));
+ fprintf(out, "source2=");
+ fprintf(out, "\"%s\"\n", Rast_get_history(&hist, HIST_DATSRC_2));
+ fprintf(out, "description=");
+ fprintf(out, "\"%s\"\n", Rast_get_history(&hist, HIST_KEYWRD));
+ if (Rast_history_length(&hist)) {
+ for (i = 0; i < Rast_history_length(&hist); i++)
+ fprintf(out, "comments_%d=", i);
+ fprintf(out, "\"%s\"\n", Rast_history_line(&hist, i));
+ }
+ }
else {
G_fatal_error(_("Error while reading history file"));
}
More information about the grass-commit
mailing list