]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Make --help option put its output on stderr.
authorChris Hanson <org/chris-hanson/cph>
Sun, 24 Jan 2021 03:33:10 +0000 (19:33 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 24 Jan 2021 03:40:26 +0000 (19:40 -0800)
Also clean up the output by eliminating unnecessary stuff.

(cherry picked from commit 6424f90bf1e56437fbbf8d7a80998e6497200f3f)

src/microcode/option.c
src/runtime/command-line.scm

index 571512b58c559bd178aa4fc986d92240ea7c0870..06013a2fa1e80fb72d25ee4d50e3c4e71f5027ee 100644 (file)
@@ -224,12 +224,8 @@ for the band.\n\
 "\n\
 --prepend-library DIRNAME\n\
   Adds DIRNAME to the front of the library search path.  This option\n\
-  takes one value and can be specified once.\n\
-\n\
-Please report bugs to %s.\n\
-\n\
-Additional options may be supported by the band (and described below).\n\
-\n", DEFAULT_LIBRARY_PATH, DEFAULT_STD_BAND, PACKAGE_BUGREPORT);
+  takes one value and can be specified once.\n",
+              DEFAULT_LIBRARY_PATH, DEFAULT_STD_BAND);
 }
 \f
 #ifndef DEFAULT_HEAP_SIZE
@@ -1016,7 +1012,10 @@ read_command_line_options (int argc, const char ** argv)
       outf_flush_console ();
     }
   if (option_show_help)
-    print_help ();
+    {
+      option_batch_mode = true;
+      print_help ();
+    }
   if (option_summary)
     describe_options ();
 }
index c410baf4361b332fe1897a118b2a472638e2d1ac..381f07da17f633d9cda7a1a00beaf8ca6d4c9059 100644 (file)
@@ -218,19 +218,20 @@ USA.
   (values '() #f))
 
 (define (show-command-line-options)
-  (write-string "
-
-ADDITIONAL OPTIONS supported by this band:\n")
-  (do ((parsers (sort *command-line-parsers*
-                     (lambda (a b) (string<? (car a) (car b))))
-               (cdr parsers)))
-      ((null? parsers))
-    (let ((description (cadar parsers)))
-      (if (not (fix:= 0 (string-length description)))
-         (begin
-           (newline)
-           (write-string description)
-           (newline)))))
+  (let ((port (console-error-port)))
+    (do ((parsers (sort *command-line-parsers*
+                       (lambda (a b) (string<? (car a) (car b))))
+                 (cdr parsers)))
+       ((null? parsers))
+      (let ((description (cadar parsers)))
+       (if (not (fix:= 0 (string-length description)))
+           (begin
+             (newline port)
+             (write-string description port)
+             (newline port)))))
+    (newline port)
+    (write-string "Please report bugs to bug-mit-scheme@gnu.org." port)
+    (newline port))
   (exit))
 \f
 (add-boot-init!