[GRASS-SVN] r40606 - grass/branches/develbranch_6/raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 21 22:00:33 EST 2010


Author: hamish
Date: 2010-01-21 22:00:32 -0500 (Thu, 21 Jan 2010)
New Revision: 40606

Modified:
   grass/branches/develbranch_6/raster/r.colors/main.c
Log:
allow color=rules rules=file.txt

Modified: grass/branches/develbranch_6/raster/r.colors/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.colors/main.c	2010-01-22 02:22:06 UTC (rev 40605)
+++ grass/branches/develbranch_6/raster/r.colors/main.c	2010-01-22 03:00:32 UTC (rev 40606)
@@ -273,11 +273,16 @@
     if (interactive && (style || rules || cmap))
 	G_fatal_error(_("Interactive mode is incompatible with \"color\", \"rules\", and \"raster\" options"));
 
-    if ((style && (cmap || rules)) || (cmap && rules))
-	G_fatal_error(_("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
+    if ((style && (cmap || rules)) || (cmap && rules)) {
+	if(((style && rules && !cmap) && strcmp(style, "rules") == 0))
+	    style = NULL;
+	else
+	    G_fatal_error(
+		_("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
+    }
 
     /* handle rules="-" (from stdin) by translating that to colors=rules */
-    /* this method should not be ported to GRASS 7 where color=rules DNE */
+    /* this method should not be ported to GRASS 7 verbatim, as color=rules DNE */
     if (rules && strcmp(rules, "-") == 0) {
 	style = G_store("rules");
 	rules = NULL;



More information about the grass-commit mailing list