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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 18 08:28:51 PST 2014


Author: neteler
Date: 2014-12-18 08:28:51 -0800 (Thu, 18 Dec 2014)
New Revision: 63593

Modified:
   grass/trunk/lib/gis/parser.c
   grass/trunk/lib/gis/parser_dependencies.c
Log:
libgis parser: more descriptive error messages

Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2014-12-18 16:04:03 UTC (rev 63592)
+++ grass/trunk/lib/gis/parser.c	2014-12-18 16:28:51 UTC (rev 63593)
@@ -847,7 +847,7 @@
 
     /* Flag is not valid if there are no flags to set */
     if (!st->n_flags) {
-	G_asprintf(&err, _("Sorry, <%c> is not a valid flag"), f);
+	G_asprintf(&err, _("%s: Sorry, <%c> is not a valid flag"), G_program_name(), f);
 	append_error(err);
 	return;
     }
@@ -864,7 +864,7 @@
 	flag = flag->next_flag;
     }
 
-    G_asprintf(&err, _("Sorry, <%c> is not a valid flag"), f);
+    G_asprintf(&err, _("%s: Sorry, <%c> is not a valid flag"), G_program_name(), f);
     append_error(err);
 }
 
@@ -981,7 +981,7 @@
     }
 
     if (found > 1 && prefix > 1) {
-	G_asprintf(&err, _("Sorry, <%s=> is ambiguous"), the_key);
+	G_asprintf(&err, _("%s: Sorry, <%s=> is ambiguous"), G_program_name(), the_key);
 	append_error(err);
 	return;
     }
@@ -1007,7 +1007,7 @@
 
     /* If there is no match, complain */
     if (found == 0) {
-        G_asprintf(&err, _("Sorry, <%s> is not a valid parameter"), the_key);
+        G_asprintf(&err, _("%s: Sorry, <%s> is not a valid parameter"), G_program_name(), the_key);
         append_error(err);
         return;
     }

Modified: grass/trunk/lib/gis/parser_dependencies.c
===================================================================
--- grass/trunk/lib/gis/parser_dependencies.c	2014-12-18 16:04:03 UTC (rev 63592)
+++ grass/trunk/lib/gis/parser_dependencies.c	2014-12-18 16:28:51 UTC (rev 63593)
@@ -212,7 +212,7 @@
 {
     if (count_present(rule, 0) < 1) {
 	char *err;
-	G_asprintf(&err, _("At least one of %s is required"),
+	G_asprintf(&err, _("At least one of the following options is required: %s"),
 		   describe_rule(rule, 0, 0));
 	append_error(err);
     }



More information about the grass-commit mailing list