groff-commit
[Top][All Lists]
Advanced

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

[groff] 66/80: [refer]: Exit with status 2 on usage errors.


From: G. Branden Robinson
Subject: [groff] 66/80: [refer]: Exit with status 2 on usage errors.
Date: Sat, 30 Nov 2024 04:02:27 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit d42e9ea97940169e20f55d481cc3ef60665dee99
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 29 22:45:28 2024 -0600

    [refer]: Exit with status 2 on usage errors.
    
    * src/utils/refer/refer.cpp (main): Exit with status 2, not 1, on usage
      errors.  Continues commit 89283b0935, 18 October.
    
    * NEWS: Note the change.
---
 ChangeLog                   | 8 ++++++++
 NEWS                        | 8 ++++----
 src/preproc/refer/refer.cpp | 6 +++---
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5d3073f7c..ffd74c672 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-29  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [refer]: Exit with status 2 on usage errors.
+
+       * src/utils/refer/refer.cpp (main): Exit with status 2, not 1,
+       on usage errors.  Continues commit 89283b0935, 18 October.
+       * NEWS: Note the change.
+
 2024-11-29  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/refer/refer.cpp (main): Skip rest of argument to
diff --git a/NEWS b/NEWS
index 3d928c885..17a4ed9b0 100644
--- a/NEWS
+++ b/NEWS
@@ -603,10 +603,10 @@ Miscellaneous
 -------------
 
 *  The commands addftinfo, grodvi, post-grohtml, grolbp, grolj4, grops,
-   grotty, eqn, pre-grohtml, gxditview, pic, preconv, soelim, tbl,
-   groff, troff, hpftodit, lkbib, lookbib, tfmtodit, and xtotroff now
-   exit with status 2 instead of 1 on usage errors.  grn now exits with
-   status 2 on a usage error instead of a successful status (0).
+   grotty, eqn, pre-grohtml, gxditview, pic, preconv, refer, soelim,
+   tbl, groff, troff, hpftodit, lkbib, lookbib, tfmtodit, and xtotroff
+   now exit with status 2 instead of 1 on usage errors.  grn now exits
+   with status 2 on a usage error instead of a successful status (0).
 
 *  Support for terminal devices using the CCSID 1047 (EBCDIC) encoding
    has been withdrawn.
diff --git a/src/preproc/refer/refer.cpp b/src/preproc/refer/refer.cpp
index 811d19a2d..7deddca58 100644
--- a/src/preproc/refer/refer.cpp
+++ b/src/preproc/refer/refer.cpp
@@ -180,7 +180,7 @@ int main(int argc, char **argv)
            else {
              error("'f' option requires an argument");
              usage(stderr);
-             exit(1);
+             exit(2);
            }
          }
          else {
@@ -315,7 +315,7 @@ int main(int argc, char **argv)
            else {
              error("option 'p' requires an argument");
              usage(stderr);
-             exit(1);
+             exit(2);
            }
          }
          else {
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
       default:
        error("unrecognized option '%1'", opt);
        usage(stderr);
-       exit(1);
+       exit(2);
        break;
       }
     }



reply via email to

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