Quellcode durchsuchen

Add GRASS_FULL_OPTION_NAMES environment variable (issue https://trac.osgeo.org/grass/ticket/2409, comment:175)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63765 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements vor 10 Jahren
Ursprung
Commit
db49796536
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      lib/gis/parser.c

+ 6 - 0
lib/gis/parser.c

@@ -1034,6 +1034,9 @@ void set_option(const char *string)
         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 @@ int check_string(const char *ans, const char **opts, int *result)
     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;