[GRASS-SVN] r73144 - grass/trunk/raster/r.cost

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 23 07:25:41 PDT 2018


Author: wenzeslaus
Date: 2018-08-23 07:25:40 -0700 (Thu, 23 Aug 2018)
New Revision: 73144

Modified:
   grass/trunk/raster/r.cost/main.c
Log:
r.cost: reorder options, the usual order is input-output

The main options input and output are always or almost always in
the order input-output not the other way aroud as it was here.
With output-input order, r.cost travel_time output=travel_cost caused:
ERROR: Option <output> does not accept multiple answers
ERROR: Required parameter <input> not set
Now the help says:
r.cost input=name output=name

Although we don't consider using unnamed parameter or order of parameters
part of API, r72720 which swapped input and output breaks any user
scripts, workflows or documentation which use the first unamed parameter.


Modified: grass/trunk/raster/r.cost/main.c
===================================================================
--- grass/trunk/raster/r.cost/main.c	2018-08-23 14:16:05 UTC (rev 73143)
+++ grass/trunk/raster/r.cost/main.c	2018-08-23 14:25:40 UTC (rev 73144)
@@ -170,12 +170,12 @@
 	  "geographic locations on an input raster map "
 	  "whose cell category values represent cost.");
 
-    opt1 = G_define_standard_option(G_OPT_R_OUTPUT);
-
     opt2 = G_define_standard_option(G_OPT_R_INPUT);
     opt2->description =
 	_("Name of input raster map containing grid cell cost information");
 
+    opt1 = G_define_standard_option(G_OPT_R_OUTPUT);
+
     opt_solve = G_define_standard_option(G_OPT_R_INPUT);
     opt_solve->key = "solver";
     opt_solve->required = NO;



More information about the grass-commit mailing list