groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 02/07: [grohtml]: Use warning() upon usage errors.


From: G. Branden Robinson
Subject: [groff] 02/07: [grohtml]: Use warning() upon usage errors.
Date: Sat, 22 May 2021 09:14:45 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 5ceb0eee6676ebed0836f884ba5e3769c24b80d9
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 22 18:14:51 2021 +1000

    [grohtml]: Use warning() upon usage errors.
    
    * src/preproc/html/pre-html.cpp (scanArguments):
    * src/devices/grohtml/post-html.cpp (main): Use libgroff's warning()
      instead of printf() to emit diagnostic about unrecognized paramter to
      `-x` option.  This sends the diagnostic to the standard error stream
      and continues the long process of fixing Savannah #52463.
---
 ChangeLog                         | 9 +++++++++
 src/devices/grohtml/post-html.cpp | 2 +-
 src/preproc/html/pre-html.cpp     | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95e72bf..0f39b78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2021-05-22  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/preproc/html/pre-html.cpp (scanArguments):
+       * src/devices/grohtml/post-html.cpp (main): Use libgroff's
+       warning() instead of printf() to emit diagnostic about
+       unrecognized paramter to `-x` option.  This sends the diagnostic
+       to the standard error stream and continues the long process of
+       fixing Savannah #52463.
+
+2021-05-22  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/groff_www.7.man: Stop using the "www" macro package.  The
        macros it exposes are not part of the quasi-standardized man(7)
        language, and thus should not be used in man(7) documents.  See
diff --git a/src/devices/grohtml/post-html.cpp 
b/src/devices/grohtml/post-html.cpp
index 57740ff..76e088c 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -5528,7 +5528,7 @@ int main(int argc, char **argv)
       } else if (strcmp(optarg, "4") == 0)
        dialect = html4;
       else
-       printf("unsupported html dialect %s (defaulting to html4)\n", optarg);
+       warning("unsupported HTML dialect: '%1'", optarg);
       break;
     case 'y':
       groff_sig = TRUE;
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index b2eea71..72d8202 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1665,7 +1665,7 @@ static int scanArguments(int argc, char **argv)
       else if (strcmp(optarg, "4") == 0)
        dialect = html4;
       else
-       printf("unsupported html dialect %s (defaulting to html4)\n", optarg);
+       warning("unsupported HTML dialect: '%1'", optarg);
       break;
     case 'y':
       // handled by post-grohtml (create groff signature)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]