Parcourir la source

libgis parser: more descriptive error messages (trunk, https://trac.osgeo.org/grass/changeset/63593)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@63594 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler il y a 10 ans
Parent
commit
dea76806fe
2 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 4 4
      lib/gis/parser.c
  2. 1 1
      lib/gis/parser_dependencies.c

+ 4 - 4
lib/gis/parser.c

@@ -847,7 +847,7 @@ void set_flag(int f)
 
     /* 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 @@ void set_flag(int f)
 	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 @@ void set_option(const char *string)
     }
 
     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 @@ void set_option(const char *string)
 
     /* 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;
     }

+ 1 - 1
lib/gis/parser_dependencies.c

@@ -212,7 +212,7 @@ static void check_required(const struct rule *rule)
 {
     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);
     }