[GRASS-SVN] r62880 - in grass/branches/releasebranch_7_0: . raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 23 20:16:53 PST 2014


Author: annakrat
Date: 2014-11-23 20:16:53 -0800 (Sun, 23 Nov 2014)
New Revision: 62880

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/raster/r.colors/edit_colors.c
Log:
r.colors: use new parser option dependencies (merge from trunk, r62879)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62831,62838,62847,62856
   + /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62831,62838,62847,62856,62879

Modified: grass/branches/releasebranch_7_0/raster/r.colors/edit_colors.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.colors/edit_colors.c	2014-11-24 04:08:48 UTC (rev 62879)
+++ grass/branches/releasebranch_7_0/raster/r.colors/edit_colors.c	2014-11-24 04:16:53 UTC (rev 62880)
@@ -147,6 +147,13 @@
     flag.e->description = _("Histogram equalization");
     flag.e->guisection = _("Define");
 
+    G_option_exclusive(opt.maps, opt.file, NULL);
+    G_option_required(opt.maps, opt.file, NULL);
+    G_option_exclusive(opt.rast, opt.volume, NULL);
+    G_option_required(opt.rast, opt.volume, opt.colr, opt.rules, flag.r, NULL);
+    G_option_exclusive(opt.colr, opt.rules, opt.rast, opt.volume, NULL);
+    G_option_exclusive(flag.g, flag.a, NULL);
+
     if (G_parser(argc, argv))
         exit(EXIT_FAILURE);
 
@@ -161,37 +168,11 @@
     rules = opt.rules->answer;
     file = opt.file->answer;
 
-    if (opt.maps->answer && opt.file->answer)
-        G_fatal_error(_("Options <%s> and <%s> are mutually exclusive"),
-		      opt.maps->key, opt.file->key);
-
-    if (!opt.maps->answer && !opt.file->answer)
-        G_fatal_error(_("Option <%s> or <%s> must be specified"),
-		      opt.maps->key, opt.file->key);
-
-    if (opt.rast->answer && opt.volume->answer)
-        G_fatal_error(_("Options <%s> and <%s> are mutually exclusive"),
-		      opt.rast->key, opt.volume->key);
-
     if (opt.rast->answer)
         cmap = opt.rast->answer;
     if (opt.volume->answer)
         cmap = opt.volume->answer;
 
-    if (!cmap && !style && !rules && !remove)
-        G_fatal_error(_("One of -%c or options <%s>, <%s> or <%s> "
-			"must be specified"), flag.r->key, opt.colr->key,
-			opt.rast->key, opt.rules->key);
-    
-    if (!!style + !!cmap + !!rules > 1)
-        G_fatal_error(_("Options <%s>, <%s>, and <%s> are mutually "
-			"exclusive"), opt.colr->key, opt.rules->key,
-		      opt.rast->key);
-    
-    if (flag.g->answer && flag.a->answer)
-        G_fatal_error(_("Flags -%c and -%c are mutually exclusive"),
-		      flag.g->key, flag.a->key);
-
     is_from_stdin = rules && strcmp(rules, "-") == 0;
     if (is_from_stdin)
         rules = NULL;



More information about the grass-commit mailing list