[GRASS-SVN] r72457 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 21 02:03:11 PDT 2018


Author: martinl
Date: 2018-03-21 02:03:10 -0700 (Wed, 21 Mar 2018)
New Revision: 72457

Modified:
   grass/trunk/lib/gis/parser.c
Log:
libgis: improve parser UI description error reporting

Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2018-03-21 01:07:35 UTC (rev 72456)
+++ grass/trunk/lib/gis/parser.c	2018-03-21 09:03:10 UTC (rev 72457)
@@ -344,6 +344,9 @@
     G_basename(tmp_name, "exe");
     st->pgm_name = tmp_name;
 
+    if (!st->module_info.label && !st->module_info.description)
+        G_warning(_("Bug in UI description. Missing module description"));
+
     /* Stash default answers */
 
     opt = &st->first_option;
@@ -351,8 +354,12 @@
 	if (opt->required)
 	    st->has_required = 1;
 
+        if (!opt->key)
+            G_warning(_("Bug in UI description. Missing option key"));
 	if (!valid_option_name(opt->key))
-	    G_warning(_("BUG in option name, '%s' is not valid"), opt->key);
+	    G_warning(_("Bug in UI description. Option key <%s> is not valid"), opt->key);
+        if (!opt->label && !opt->description)
+            G_warning(_("Bug in UI description. Description for option <%s> missing"), opt->key ? opt->key : "?");
 
 	/* Parse options */
 	if (opt->options) {
@@ -404,7 +411,7 @@
 			j++;
 		    }
 		    if (!found) {
-			G_warning(_("BUG in descriptions, option '%s' in <%s> does not exist"),
+			G_warning(_("Bug in UI description. Option '%s' in <%s> does not exist"),
 				  tokens[i], opt->key);
 		    }
 		    else {



More information about the grass-commit mailing list