[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 04/20: Make more commands' exit status 2 on usage error.
From: |
G. Branden Robinson |
Subject: |
[groff] 04/20: Make more commands' exit status 2 on usage error. |
Date: |
Mon, 21 Oct 2024 20:14:51 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 89283b09355bb86dd49de4a160ebf8ce11400a3a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 18 17:05:00 2024 -0500
Make more commands' exit status 2 on usage error.
* src/devices/grodvi/dvi.cpp (main):
* src/devices/grohtml/post-html.cpp (main):
* src/devices/grolbp/lbp.cpp (main):
* src/devices/grolj4/lj4.cpp (main):
* src/devices/grops/ps.cpp (main):
* src/devices/grotty/tty.cpp (main):
* src/preproc/eqn/main.cpp (main):
* src/preproc/grn/main.cpp (main):
* src/preproc/html/pre-html.cpp (main):
* src/preproc/pic/main.cpp (main):
* src/preproc/preconv/preconv.cpp (main):
* src/preproc/soelim/soelim.cpp (main):
* src/preproc/tbl/main.cpp (main):
* src/roff/groff/groff.cpp (main):
* src/roff/troff/input.cpp (main):
* src/utils/hpftodit/hpftodit.cpp (usage):
* src/utils/indxbib/indxbib.cpp (main):
* src/utils/lkbib/lkbib.cpp (main):
* src/utils/lookbib/lookbib.cpp (main):
* src/utils/tfmtodit/tfmtodit.cpp (main):
* src/utils/xtotroff/xtotroff.c (main): Do it.
* src/devices/grodvi/grodvi.1.man (Exit status):
* src/devices/grohtml/grohtml.1.man (Exit status):
* src/devices/grolbp/grolbp.1.man (Exit status):
* src/devices/grolj4/grolj4.1.man (Exit status):
* src/devices/grops/grops.1.man (Exit status):
* src/devices/grotty/grotty.1.man (Exit status):
* src/preproc/eqn/eqn.1.man (Exit status):
* src/preproc/grn/grn.1.man (Exit status):
* src/preproc/pic/pic.1.man (Exit status):
* src/preproc/preconv/preconv.1.man (Exit status):
* src/preproc/refer/refer.1.man (Exit status):
* src/preproc/soelim/soelim.1.man (Exit status):
* src/preproc/tbl/tbl.1.man (Exit status):
* src/roff/troff/troff.1.man (Exit status):
* src/utils/hpftodit/hpftodit.1.man (Exit status):
* src/utils/indxbib/indxbib.1.man (Exit status):
* src/utils/lkbib/lkbib.1.man (Exit status):
* src/utils/lookbib/lookbib.1.man (Exit status):
* src/utils/tfmtodit/tfmtodit.1.man (Exit status):
* src/utils/xtotroff/xtotroff.1.man (Exit status): Add section.
* NEWS: Add item.
---
ChangeLog | 49 +++++++++++++++++++++++++++++++++++++++
NEWS | 6 +++++
src/devices/grodvi/dvi.cpp | 2 +-
src/devices/grodvi/grodvi.1.man | 15 ++++++++++++
src/devices/grohtml/grohtml.1.man | 19 ++++++++++++++-
src/devices/grohtml/post-html.cpp | 2 +-
src/devices/grolbp/grolbp.1.man | 17 +++++++++++++-
src/devices/grolbp/lbp.cpp | 2 +-
src/devices/grolj4/grolj4.1.man | 17 +++++++++++++-
src/devices/grolj4/lj4.cpp | 2 +-
src/devices/grops/grops.1.man | 17 +++++++++++++-
src/devices/grops/ps.cpp | 2 +-
src/devices/grotty/grotty.1.man | 15 ++++++++++++
src/devices/grotty/tty.cpp | 2 +-
src/preproc/eqn/eqn.1.man | 17 +++++++++++++-
src/preproc/eqn/main.cpp | 2 +-
src/preproc/grn/grn.1.man | 17 +++++++++++++-
src/preproc/grn/main.cpp | 2 +-
src/preproc/html/pre-html.cpp | 2 +-
src/preproc/pic/main.cpp | 2 +-
src/preproc/pic/pic.1.man | 15 ++++++++++++
src/preproc/preconv/preconv.1.man | 15 ++++++++++++
src/preproc/preconv/preconv.cpp | 2 +-
src/preproc/refer/refer.1.man | 17 +++++++++++++-
src/preproc/soelim/soelim.1.man | 17 +++++++++++++-
src/preproc/soelim/soelim.cpp | 2 +-
src/preproc/tbl/main.cpp | 2 +-
src/preproc/tbl/tbl.1.man | 15 ++++++++++++
src/roff/groff/groff.cpp | 2 +-
src/roff/troff/input.cpp | 2 +-
src/roff/troff/troff.1.man | 15 ++++++++++++
src/utils/hpftodit/hpftodit.1.man | 17 +++++++++++++-
src/utils/hpftodit/hpftodit.cpp | 2 +-
src/utils/indxbib/indxbib.1.man | 17 +++++++++++++-
src/utils/indxbib/indxbib.cpp | 2 +-
src/utils/lkbib/lkbib.1.man | 17 +++++++++++++-
src/utils/lkbib/lkbib.cpp | 2 +-
src/utils/lookbib/lookbib.1.man | 17 +++++++++++++-
src/utils/lookbib/lookbib.cpp | 2 +-
src/utils/tfmtodit/tfmtodit.1.man | 17 +++++++++++++-
src/utils/tfmtodit/tfmtodit.cpp | 2 +-
src/utils/xtotroff/xtotroff.1.man | 17 +++++++++++++-
src/utils/xtotroff/xtotroff.c | 2 +-
43 files changed, 392 insertions(+), 35 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d1267a31d..d5f724ed3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2024-10-18 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ Make more commands exit with status 2 on usage error.
+
+ * src/devices/grodvi/dvi.cpp (main):
+ * src/devices/grohtml/post-html.cpp (main):
+ * src/devices/grolbp/lbp.cpp (main):
+ * src/devices/grolj4/lj4.cpp (main):
+ * src/devices/grops/ps.cpp (main):
+ * src/devices/grotty/tty.cpp (main):
+ * src/preproc/eqn/main.cpp (main):
+ * src/preproc/grn/main.cpp (main):
+ * src/preproc/html/pre-html.cpp (main):
+ * src/preproc/pic/main.cpp (main):
+ * src/preproc/preconv/preconv.cpp (main):
+ * src/preproc/soelim/soelim.cpp (main):
+ * src/preproc/tbl/main.cpp (main):
+ * src/roff/groff/groff.cpp (main):
+ * src/roff/troff/input.cpp (main):
+ * src/utils/hpftodit/hpftodit.cpp (usage):
+ * src/utils/indxbib/indxbib.cpp (main):
+ * src/utils/lkbib/lkbib.cpp (main):
+ * src/utils/lookbib/lookbib.cpp (main):
+ * src/utils/tfmtodit/tfmtodit.cpp (main):
+ * src/utils/xtotroff/xtotroff.c (main): Do it.
+
+ * src/devices/grodvi/grodvi.1.man (Exit status):
+ * src/devices/grohtml/grohtml.1.man (Exit status):
+ * src/devices/grolbp/grolbp.1.man (Exit status):
+ * src/devices/grolj4/grolj4.1.man (Exit status):
+ * src/devices/grops/grops.1.man (Exit status):
+ * src/devices/grotty/grotty.1.man (Exit status):
+ * src/preproc/eqn/eqn.1.man (Exit status):
+ * src/preproc/grn/grn.1.man (Exit status):
+ * src/preproc/pic/pic.1.man (Exit status):
+ * src/preproc/preconv/preconv.1.man (Exit status):
+ * src/preproc/refer/refer.1.man (Exit status):
+ * src/preproc/soelim/soelim.1.man (Exit status):
+ * src/preproc/tbl/tbl.1.man (Exit status):
+ * src/roff/troff/troff.1.man (Exit status):
+ * src/utils/hpftodit/hpftodit.1.man (Exit status):
+ * src/utils/indxbib/indxbib.1.man (Exit status):
+ * src/utils/lkbib/lkbib.1.man (Exit status):
+ * src/utils/lookbib/lookbib.1.man (Exit status):
+ * src/utils/tfmtodit/tfmtodit.1.man (Exit status):
+ * src/utils/xtotroff/xtotroff.1.man (Exit status): Add section.
+
+ * NEWS: Add item.
+
2024-10-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.c (device_request): Drop declaration of
diff --git a/NEWS b/NEWS
index 29f33d99f..7b42c12a8 100644
--- a/NEWS
+++ b/NEWS
@@ -516,6 +516,12 @@ Output drivers
Miscellaneous
-------------
+* The commands 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).
+
* Support for terminal devices using the CCSID 1047 (EBCDIC) encoding
has been withdrawn.
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index 45d585b63..02a78c9e1 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -962,7 +962,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/devices/grodvi/grodvi.1.man b/src/devices/grodvi/grodvi.1.man
index b9afe1f90..dd8c4f266 100644
--- a/src/devices/grodvi/grodvi.1.man
+++ b/src/devices/grodvi/grodvi.1.man
@@ -555,6 +555,21 @@ The default thickness is
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%grodvi
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/devices/grohtml/grohtml.1.man
b/src/devices/grohtml/grohtml.1.man
index 28953e31f..590bdd7cd 100644
--- a/src/devices/grohtml/grohtml.1.man
+++ b/src/devices/grohtml/grohtml.1.man
@@ -9,7 +9,7 @@ output driver for HTML
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1999-2022 Free Software Foundation, Inc.
+.\" Copyright (C) 1999-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -601,6 +601,23 @@ is also specified).
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%pre\-grohtml
+and
+.I \%post\-grohtml
+each exit with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index 84a0c2220..868236388 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -5645,7 +5645,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0 == "unhandled getopt_long return value");
diff --git a/src/devices/grolbp/grolbp.1.man b/src/devices/grolbp/grolbp.1.man
index 69e95a65f..e17ab043c 100644
--- a/src/devices/grolbp/grolbp.1.man
+++ b/src/devices/grolbp/grolbp.1.man
@@ -14,7 +14,7 @@ output driver for Canon CaPSL printers
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1994-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1994-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -432,6 +432,21 @@ the default is
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%grolbp
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index c28f2e672..de1660fcc 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -722,7 +722,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(EXIT_FAILURE);
+ exit(2);
break;
default:
assert(0 == "unhandled getopt_long return value");
diff --git a/src/devices/grolj4/grolj4.1.man b/src/devices/grolj4/grolj4.1.man
index b29ce1160..9db021060 100644
--- a/src/devices/grolj4/grolj4.1.man
+++ b/src/devices/grolj4/grolj4.1.man
@@ -9,7 +9,7 @@ output driver for HP LaserJet 4 and compatible printers
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1994-2020, 2022 Free Software Foundation, Inc.
+.\" Copyright (C) 1994-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -818,6 +818,21 @@ the default is
(0.04\~em).
.
.
+.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%grolj4
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
.br
.ne 4v \" Keep section heading and paragraph together.
.\" ====================================================================
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index ce9de79df..0ebfda6ac 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -688,7 +688,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/devices/grops/grops.1.man b/src/devices/grops/grops.1.man
index 9cfecc956..a8c35a561 100644
--- a/src/devices/grops/grops.1.man
+++ b/src/devices/grops/grops.1.man
@@ -9,7 +9,7 @@ output driver for PostScript
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2018, 2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -1666,6 +1666,21 @@ $ \c
when the command runs.
.
.
+.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%grops
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
.br
.ne 3v
.\" ====================================================================
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index 053bb6045..5fb47d606 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -1861,7 +1861,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/devices/grotty/grotty.1.man b/src/devices/grotty/grotty.1.man
index 2a50a7fc5..8f75b742b 100644
--- a/src/devices/grotty/grotty.1.man
+++ b/src/devices/grotty/grotty.1.man
@@ -546,6 +546,21 @@ Use only underlining for bold-italic characters in legacy
output format.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%grotty
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 976c5afdf..82af90f7b 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -1003,7 +1003,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(EXIT_FAILURE);
+ exit(2);
break;
default:
assert(0 == "unhandled getopt_long return value");
diff --git a/src/preproc/eqn/eqn.1.man b/src/preproc/eqn/eqn.1.man
index 93d95ca7f..634a8b056 100644
--- a/src/preproc/eqn/eqn.1.man
+++ b/src/preproc/eqn/eqn.1.man
@@ -10,7 +10,7 @@ or MathML
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2023 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -1907,6 +1907,21 @@ The default device is
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@eqn
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 2b81b8877..f82e3800d 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -419,7 +419,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(EXIT_FAILURE);
+ exit(2);
break;
default:
assert(0 == "unhandled getopt_long return value");
diff --git a/src/preproc/grn/grn.1.man b/src/preproc/grn/grn.1.man
index 0be9b02f9..8affd0689 100644
--- a/src/preproc/grn/grn.1.man
+++ b/src/preproc/grn/grn.1.man
@@ -10,7 +10,7 @@ documents
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 2000-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 2000-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -943,6 +943,21 @@ for a list of valid devices.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@grn
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/preproc/grn/main.cpp b/src/preproc/grn/main.cpp
index e5a92f80e..d632e897b 100644
--- a/src/preproc/grn/main.cpp
+++ b/src/preproc/grn/main.cpp
@@ -353,7 +353,7 @@ main(int argc,
if (strcmp(*argv,"--help")==0) {
case '?':
usage(stdout);
- exit(0);
+ exit(2);
break;
}
// fallthrough
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 16f24cb81..8b86add80 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1699,7 +1699,7 @@ static int scanArguments(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(EXIT_FAILURE);
+ exit(2);
break;
default:
break;
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index f7e194ff3..6e4d27f06 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -601,7 +601,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/preproc/pic/pic.1.man b/src/preproc/pic/pic.1.man
index 1b61bd3f5..8db6e826a 100644
--- a/src/preproc/pic/pic.1.man
+++ b/src/preproc/pic/pic.1.man
@@ -1408,6 +1408,21 @@ tools.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@pic
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/preproc/preconv/preconv.1.man
b/src/preproc/preconv/preconv.1.man
index 6f04e5ab5..b0e314262 100644
--- a/src/preproc/preconv/preconv.1.man
+++ b/src/preproc/preconv/preconv.1.man
@@ -549,6 +549,21 @@ requests.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%preconv
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH "See also"
.\" ====================================================================
.
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index cbd9adae1..73cddcb97 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -1301,7 +1301,7 @@ main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/preproc/refer/refer.1.man b/src/preproc/refer/refer.1.man
index d2b6bb649..77ff5880f 100644
--- a/src/preproc/refer/refer.1.man
+++ b/src/preproc/refer/refer.1.man
@@ -8,7 +8,7 @@
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2023 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -1897,6 +1897,21 @@ command instead of in the normal way.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@refer
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/preproc/soelim/soelim.1.man b/src/preproc/soelim/soelim.1.man
index 4f5193f39..7bec18434 100644
--- a/src/preproc/soelim/soelim.1.man
+++ b/src/preproc/soelim/soelim.1.man
@@ -10,7 +10,7 @@ or other text files
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -437,6 +437,21 @@ the last one specified controls.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@soelim
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH "See also"
.\" ====================================================================
.
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 415d19f40..6ac8de06c 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 7ad597b52..2ac842752 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1666,7 +1666,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(EXIT_FAILURE);
+ exit(2);
break;
default:
assert(0 == "unhandled getopt_long return value");
diff --git a/src/preproc/tbl/tbl.1.man b/src/preproc/tbl/tbl.1.man
index 8ea0c124a..ecc3b635a 100644
--- a/src/preproc/tbl/tbl.1.man
+++ b/src/preproc/tbl/tbl.1.man
@@ -1579,6 +1579,21 @@ as a leader character.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@tbl
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Limitations
.\" ====================================================================
.
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 3b8484977..41bc362d7 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -363,7 +363,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- xexit(EXIT_FAILURE);
+ xexit(2);
break;
default:
assert(0 == "no case to handle option character");
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 434513d85..afcfb4b1b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -9024,7 +9024,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr, argv[0]);
- exit(1);
+ exit(2);
break; // never reached
default:
assert(0 == "unhandled case of command-line option");
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index 5b4e5336d..5a633658e 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -801,6 +801,21 @@ are encouraged to use this setting.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@troff
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/utils/hpftodit/hpftodit.1.man
b/src/utils/hpftodit/hpftodit.1.man
index f39aebbbc..f4991667c 100644
--- a/src/utils/hpftodit/hpftodit.1.man
+++ b/src/utils/hpftodit/hpftodit.1.man
@@ -10,7 +10,7 @@ and
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1994-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1994-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -403,6 +403,21 @@ the search order is reversed.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%hpftodit
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index a617ff047..6f7851564 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -400,7 +400,7 @@ static void
usage()
{
usage(stderr);
- exit(1);
+ exit(2);
}
File::File(const char *s)
diff --git a/src/utils/indxbib/indxbib.1.man b/src/utils/indxbib/indxbib.1.man
index 54dab1598..4c3663b67 100644
--- a/src/utils/indxbib/indxbib.1.man
+++ b/src/utils/indxbib/indxbib.1.man
@@ -7,7 +7,7 @@
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -293,6 +293,21 @@ Each file is a separate record.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@indxbib
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index adb951085..63a0053c2 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -185,7 +185,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/utils/lkbib/lkbib.1.man b/src/utils/lkbib/lkbib.1.man
index a23412463..5dffa6139 100644
--- a/src/utils/lkbib/lkbib.1.man
+++ b/src/utils/lkbib/lkbib.1.man
@@ -7,7 +7,7 @@ lkbib \- search bibliographic databases
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -163,6 +163,21 @@ is\~6.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%lkbib
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Environment
.\" ====================================================================
.
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index 8eb5195b7..f73c7c1bb 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/utils/lookbib/lookbib.1.man b/src/utils/lookbib/lookbib.1.man
index 390caa648..3f8f49c55 100644
--- a/src/utils/lookbib/lookbib.1.man
+++ b/src/utils/lookbib/lookbib.1.man
@@ -7,7 +7,7 @@
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -134,6 +134,21 @@ is\~6.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I @g@lookbib
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp
index 6071e6e5c..f78b978b3 100644
--- a/src/utils/lookbib/lookbib.cpp
+++ b/src/utils/lookbib/lookbib.cpp
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
default:
assert(0);
diff --git a/src/utils/tfmtodit/tfmtodit.1.man
b/src/utils/tfmtodit/tfmtodit.1.man
index 942202677..ed3ccc3ab 100644
--- a/src/utils/tfmtodit/tfmtodit.1.man
+++ b/src/utils/tfmtodit/tfmtodit.1.man
@@ -10,7 +10,7 @@ and
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -277,6 +277,21 @@ directive to the font description file.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I tfmtodit
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index 2d259b057..fa0615817 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -731,7 +731,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- exit(1);
+ exit(2);
break;
case EOF:
assert(0 == "EOF encountered in option processing");
diff --git a/src/utils/xtotroff/xtotroff.1.man
b/src/utils/xtotroff/xtotroff.1.man
index f764481ab..be4ca0a4a 100644
--- a/src/utils/xtotroff/xtotroff.1.man
+++ b/src/utils/xtotroff/xtotroff.1.man
@@ -9,7 +9,7 @@ font metrics
.\" Legal Terms
.\" ====================================================================
.\"
-.\" Copyright (C) 2004-2022 Free Software Foundation, Inc.
+.\" Copyright (C) 2004-2024 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
@@ -189,6 +189,21 @@ a size of 10 points is assumed.
.
.
.\" ====================================================================
+.SH "Exit status"
+.\" ====================================================================
+.
+.I \%xtotroff
+exits with
+.RB status\~ 0
+on successful operation,
+.RB status\~ 2
+if the program cannot interpret its command-line arguments,
+and
+.RB status\~ 1
+if it encounters an error during operation.
+.
+.
+.\" ====================================================================
.SH Files
.\" ====================================================================
.
diff --git a/src/utils/xtotroff/xtotroff.c b/src/utils/xtotroff/xtotroff.c
index 368761fed..ab599c722 100644
--- a/src/utils/xtotroff/xtotroff.c
+++ b/src/utils/xtotroff/xtotroff.c
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
break;
case '?':
usage(stderr);
- xtotroff_exit(EXIT_FAILURE);
+ xtotroff_exit(2);
break;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 04/20: Make more commands' exit status 2 on usage error.,
G. Branden Robinson <=