[GRASS-SVN] r63774 - in grass/branches/releasebranch_7_0/lib: gis init
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 26 15:19:42 PST 2014
Author: neteler
Date: 2014-12-26 15:19:42 -0800 (Fri, 26 Dec 2014)
New Revision: 63774
Modified:
grass/branches/releasebranch_7_0/lib/gis/parser.c
grass/branches/releasebranch_7_0/lib/init/variables.html
Log:
libgis parser: backport of GRASS_FULL_OPTION_NAMES; attempt to document GRASS_FULL_OPTION_NAMES (trac #2409)
Modified: grass/branches/releasebranch_7_0/lib/gis/parser.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/gis/parser.c 2014-12-26 23:18:54 UTC (rev 63773)
+++ grass/branches/releasebranch_7_0/lib/gis/parser.c 2014-12-26 23:19:42 UTC (rev 63774)
@@ -971,7 +971,7 @@
if (strncmp(the_key, at_opt->key, key_len) == 0 ||
match_option(the_key, at_opt->key)) {
if (found >= MAX_MATCHES)
- G_fatal_error("too many matches (limit %d)", MAX_MATCHES);
+ G_fatal_error("Too many matches (limit %d)", MAX_MATCHES);
matches[found++] = at_opt;
}
}
@@ -1034,6 +1034,9 @@
append_error(err);
return;
}
+
+ if (getenv("GRASS_FULL_OPTION_NAMES") && strcmp(the_key, opt->key) != 0)
+ G_warning(_("<%s> is an abbreviation for <%s>"), the_key, opt->key);
/* Allocate memory where answer is stored */
if (opt->count++) {
@@ -1277,6 +1280,9 @@
if (found == 1)
*result = matches[0];
+ if (found > 0 && getenv("GRASS_FULL_OPTION_NAMES") && strcmp(ans, opts[matches[0]]) != 0)
+ G_warning(_("<%s> is an abbreviation for <%s>"), ans, opts[matches[0]]);
+
switch (found) {
case 0: return OUT_OF_RANGE;
case 1: return REPLACED;
Modified: grass/branches/releasebranch_7_0/lib/init/variables.html
===================================================================
--- grass/branches/releasebranch_7_0/lib/init/variables.html 2014-12-26 23:18:54 UTC (rev 63773)
+++ grass/branches/releasebranch_7_0/lib/init/variables.html 2014-12-26 23:19:42 UTC (rev 63774)
@@ -135,9 +135,10 @@
specifies an alternative location (to <tt>$GISBASE/etc/fontcap</tt>) for
the font configuration file.</dd>
- <dt>GRASS_GNUPLOT</dt>
- <dd>[<!-- m.svfit, s.probplt, s.sv -->i.spectral]<br>
- program to use for plotting <em>gnuplot</em> data.</dd>
+ <dt>GRASS_FULL_OPTION_NAMES</dt>
+ <dd>[parser]<br>
+ Generates a warning if GRASS_FULL_OPTION_NAMES is set (to anything) and
+ a found string is not an exact match for the given string.</dd>
<dt>GRASS_GUI</dt>
<dd>either <tt>text</tt> (text user interface), <tt>gtext</tt> (text
More information about the grass-commit
mailing list