groff-commit
[Top][All Lists]
Advanced

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

[groff] 22/39: [grolbp]: Alter usage message handling.


From: G. Branden Robinson
Subject: [groff] 22/39: [grolbp]: Alter usage message handling.
Date: Sat, 29 Oct 2022 14:59:58 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit d02af36003dc062c93d9bb5efbe592d5ea9de2d1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Oct 24 19:46:04 2022 -0500

    [grolbp]: Alter usage message handling.
    
    * src/devices/grolbp/lbp.cpp: Alter usage message handling.
    
      (usage): Summarize purpose of program and steer reader to man page
      (only) if help was explicitly requested, and exit successfully from
      here...
    
      (main): ...instead of calling scope.
---
 ChangeLog                  |  8 ++++++++
 src/devices/grolbp/lbp.cpp | 33 +++++++++++----------------------
 2 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 26701d32f..c8129083f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-10-24  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/devices/grolbp/lbp.cpp: Alter usage message handling.
+       (usage): Summarize purpose of program and steer reader to man
+       page (only) if help was explicitly requested, and exit
+       successfully from here...
+       (main): ...instead of calling scope.
+
 2022-10-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/devices/grolbp/lbp.cpp (main): Handle `getopt_long()`
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index 517b7b7cd..89ea47dac 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -626,30 +626,20 @@ static struct option long_options[] = {
 static void usage(FILE *stream)
 {
   fprintf(stream,
-"usage: %s [-l] [-c n] [-F dir] [-o ori] [-p fmt] [-w wid] [file ...]\n"
+"usage: %s [-l] [-c num-copies] [-F font-directory] [-o orientation]"
+" [-p paper-format] [-w width] [file ...]\n"
 "usage: %s {-v | --version}\n"
-"usage: %s {-h | --help}\n"
+"usage: %s {-h | --help}\n",
+         program_name, program_name, program_name);
+  if (stdout == stream) {
+    fputs(
 "\n"
 "Translate the output of GNU troff(1) into a CaPSL and VDM format\n"
-"suitable for Canon LBP-4 and LBP-8 printers.\n"
-"\n"
-"Options:\n"
-"  --copies=N\n"
-"  -c N    Produce N copies of each page.\n"
-"  --fontdir=DIR\n"
-"  -F DIR  Search DIR for device and font description files.\n"
-"  --landscape\n"
-"  -l      Format document in landscape orientation.\n"
-"  --orientation=ORI\n"
-"  -o ORI  Format document in orientation ORI (\"portrait\","
-" \"landscape\").\n"
-"  --papersize=FMT\n"
-"  -p FMT  Set the paper format to FMT.\n"
-"  --linewidth=WID\n"
-"  -w WID  Set default line thickness to WID thousandths of an em.\n"
-"\n"
-"See the grolbp(1) manual page.\n",
-         program_name, program_name, program_name);
+"suitable for Canon LBP-4 and LBP-8 printers.  See the grolbp(1) manual"
+" page.\n",
+         stream);
+    exit(EXIT_SUCCESS);
+  }
 }
 
 int main(int argc, char **argv)
@@ -723,7 +713,6 @@ int main(int argc, char **argv)
       }
     case 'h':
       usage(stdout);
-      exit(EXIT_SUCCESS);
       break;
     case '?':
       usage(stderr);



reply via email to

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