gbranden pushed a commit to branch master
in repository groff.

commit a2cb73996caffc161def9369a44567cef82e4095
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Nov 30 01:06:02 2024 -0600

    [indxbib]: 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                          | 7 ++++---
 src/utils/indxbib/indxbib.cpp | 7 +++++--
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b06af010..5577fb5d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-30  G. Branden Robinson <[email protected]>
+
+       [indxbib]: 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-30  G. Branden Robinson <[email protected]>
 
        * src/utils/indxbib/indxbib.cpp: Include local "nonposix.h"
diff --git a/NEWS b/NEWS
index 17a4ed9b0..91f64e258 100644
--- a/NEWS
+++ b/NEWS
@@ -604,9 +604,10 @@ Miscellaneous
 
 *  The commands addftinfo, grodvi, post-grohtml, grolbp, grolj4, grops,
    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).
+   tbl, groff, troff, hpftodit, indxbib, 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/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index 115175b93..25e8c3247 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -203,8 +203,11 @@ int main(int argc, char **argv)
       assert(0);
       break;
     }
-  if (optind >= argc && foption == 0)
-    fatal("no files and no -f option");
+  if (optind >= argc && foption == 0) {
+    error("no file operands and no command-line 'f' option specified");
+    usage(stderr);
+    exit(2);
+  }
   if (!directory) {
     char *path = get_cwd();
     store_filename(path);

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

Reply via email to