groff-commit
[Top][All Lists]
Advanced

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

[groff] 59/80: [gxditview]: Exit with status 2 on usage errors.


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

gbranden pushed a commit to branch master
in repository groff.

commit 9889e94f3ca36eab9bf20aed41ea718fe422f871
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 29 02:53:41 2024 -0600

    [gxditview]: Exit with status 2 on usage errors.
    
    * src/devices/xditview/xditview.c (Syntax): Exit with status 2 on usage
      error, not `EXIT_FAILURE`.
    * src/devices/xditview/gxditview.1.man (Exit status): Add section.
    * NEWS: Note the change.
---
 ChangeLog                            | 10 ++++++++++
 NEWS                                 |  8 ++++----
 src/devices/xditview/gxditview.1.man | 13 +++++++++++++
 src/devices/xditview/xditview.c      |  2 +-
 4 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9308f14ad..d2a3b87b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-11-29  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [gxditview]: Exit with status 2 on usage errors.
+
+       * src/devices/xditview/xditview.c (Syntax): Exit with status 2
+       on usage error, not `EXIT_FAILURE`.
+       * src/devices/xditview/gxditview.1.man (Exit status): Add
+       section.
+       * NEWS: Note the change.
+
 2024-11-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [grops]: Align with modern groff conventions.
diff --git a/NEWS b/NEWS
index 1bacc3f76..3d928c885 100644
--- a/NEWS
+++ b/NEWS
@@ -603,10 +603,10 @@ Miscellaneous
 -------------
 
 *  The commands addftinfo, grodvi, post-grohtml, grolbp, grolj4, grops,
-   grotty, eqn, pre-grohtml, 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, 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/devices/xditview/gxditview.1.man 
b/src/devices/xditview/gxditview.1.man
index f77971ee8..253970463 100644
--- a/src/devices/xditview/gxditview.1.man
+++ b/src/devices/xditview/gxditview.1.man
@@ -612,6 +612,19 @@ This option specifies a resource string to be used.
 .
 .
 .\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I gxditview
+exits with
+.RB status\~ 0
+on successful operation,
+and
+.RB status\~ 2
+if the program cannot interpret its command-line arguments.
+.
+.
+.\" ====================================================================
 .SH Environment
 .\" ====================================================================
 .
diff --git a/src/devices/xditview/xditview.c b/src/devices/xditview/xditview.c
index ff21fb6e7..56ed0e9b2 100644
--- a/src/devices/xditview/xditview.c
+++ b/src/devices/xditview/xditview.c
@@ -143,7 +143,7 @@ Syntax(const char *progname, bool had_error)
        (void) fprintf (stream, "usage: %s {-help | --help}\n",
                        progname);
        if (had_error)
-               exit(EXIT_FAILURE);
+               exit(2);
        else
                exit(EXIT_SUCCESS);
 }



reply via email to

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