From 0f3758fb9456f87c529f274bb3fee7649b2a4eb6 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Thu, 29 Aug 2019 00:54:51 +0200
Subject: [PATCH] find: improve warning when global option is specified after
 other argument

Global options like -maxdepth should be specified before other arguments
like tests, operators, etc.  The corresponding warning diagnostic was
obviously misleading, so that at least the French and the German
translations - and maybe even the English original - were not well
understood by users.

* find/parser.c (found_parser): Improve diagnostic, thus hopefully
also avoiding translation issues.  Remove extra newline.

Fixes https://sv.gnu.org/bugs/?56820
---
 NEWS          |  4 ++++
 find/parser.c | 11 +++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 401d4c51..193db1db 100644
--- a/NEWS
+++ b/NEWS
@@ -70,6 +70,10 @@ Some minor documentation improvements are listed in "Bug Fixes" below.
 
 ** Bug Fixes
 
+#56820: find: improve diagnostic when a global option like -maxdepth is
+        specified after another argument like a test, thus hopefully avoiding
+        translation issues (at least French, German).
+
 #56142: doc: fix bug #56142 by specifying which actions inhibit the
         default -print.
 
diff --git a/find/parser.c b/find/parser.c
index a3b9e762..5770487b 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -606,12 +606,11 @@ found_parser (const char *original_arg, const struct parser_table *entry)
 	    {
 	      /* option which follows a non-option */
 	      error (0, 0,
-		     _("warning: you have specified the %s "
-		       "option after a non-option argument %s, "
-		       "but options are not positional (%s affects "
-		       "tests specified before it as well as those "
-		       "specified after it).  Please specify options "
-		       "before other arguments.\n"),
+		     _("warning: you have specified the global option %s "
+		       "after the argument %s, but global options are not "
+		       "positional, i.e., %s affects tests specified before it "
+		       "as well as those specified after it.  "
+		       "Please specify global options before other arguments."),
 		     original_arg,
 		     first_nonoption_arg,
 		     original_arg);
-- 
2.22.1

