gbranden pushed a commit to branch master
in repository groff.

commit 133a33ede1ceaf874c5832a8ed4e4e6a5efaad0d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Mar 28 19:16:55 2026 -0500

    src/roff/troff/input.cpp: Recast diagnostics (2/2).
    
    * src/roff/troff/input.cpp (parse_output_page_list, main): Revise and
      parallelize wording of error diagnostics relating to invalid
      command-line option arguments.
---
 src/roff/troff/input.cpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index fffdc23e6..19a51f0e9 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -9682,8 +9682,8 @@ static void parse_output_page_list(const char *p)
     ++p;
   }
   if (*p != '\0') {
-    error("malformed argument to '-o'; page list '%1' is invalid",
-         pstart);
+    error("malformed argument to command-line option '-o';"
+         " page list '%1' is invalid", pstart);
     output_page_list = 0 /* nullptr */;
   }
 }
@@ -10026,27 +10026,28 @@ int main(int argc, char **argv)
       if (sscanf(optarg, "%d", &next_page_number) == 1)
        have_explicit_first_page_number = true;
       else
-       error("malformed argument to '-n'; page number '%1' is invalid",
-             optarg);
+       error("malformed argument to command-line option '-n';"
+             "page number '%1' is invalid", optarg);
       break;
     case 'o':
       parse_output_page_list(optarg);
       break;
     case 'd':
       if (*optarg == '\0')
-       error("'-d' requires non-empty argument");
+       error("command-line option '-d' requires non-empty argument");
       else if (*optarg == '=')
-       error("malformed argument to '-d'; string name cannot be empty"
-             " or contain an equals sign");
+       error("malformed argument to command-line option '-d';"
+             "string name cannot be empty or contain an equals sign");
       else
        add_string(optarg, &string_assignments);
       break;
     case 'r':
       if (*optarg == '\0')
-       error("'-r' requires non-empty argument");
+       error("command-line option '-r' requires non-empty argument");
       else if (*optarg == '=')
-       error("malformed argument to '-r'; register name cannot be"
-             " empty or contain an equals sign");
+       error("malformed argument to command-line option '-r';"
+             "register name cannot be empty or contain an equals"
+             "sign");
       else
        add_string(optarg, &register_assignments);
       break;

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to