[GRASS-SVN] r72419 - grass/trunk/vector/v.random
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Mar 20 09:43:12 PDT 2018
Author: martinl
Date: 2018-03-20 09:43:12 -0700 (Tue, 20 Mar 2018)
New Revision: 72419
Modified:
grass/trunk/vector/v.random/main.c
Log:
v.random: use G_option_requires + new guisection for restrict
Modified: grass/trunk/vector/v.random/main.c
===================================================================
--- grass/trunk/vector/v.random/main.c 2018-03-20 16:22:46 UTC (rev 72418)
+++ grass/trunk/vector/v.random/main.c 2018-03-20 16:43:12 UTC (rev 72419)
@@ -117,7 +117,8 @@
parm.input->required = NO;
parm.input->description = _("Restrict points to areas in input vector");
parm.input->guisection = _("Selection");
-
+ parm.input->guisection = _("Restrict");
+
parm.field = G_define_standard_option(G_OPT_V_FIELD_ALL);
parm.field->guisection = _("Selection");
@@ -175,10 +176,13 @@
flag.a = G_define_flag();
flag.a->key = 'a';
- flag.a->description = _("Generate n points for each individual area");
-
+ flag.a->description = _("Generate n points for each individual area (requires restrict parameter)");
+ flag.a->guisection = _("Restrict");
+
flag.notopo = G_define_standard_flag(G_FLG_V_TOPO);
+ G_option_requires(flag.a, parm.input, NULL);
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -218,11 +222,6 @@
G_fatal_error(_("No areas in vector map <%s>"), parm.input->answer);
}
}
- else {
- if (flag.a->answer)
- G_fatal_error(_("The <-%c> flag requires an input vector with areas"),
- flag.a->key);
- }
/* create new vector map */
if (-1 == Vect_open_new(&Out, output, flag.z->answer ? WITH_Z : WITHOUT_Z))
More information about the grass-commit
mailing list