]> diplodocus.org Git - nmh/commitdiff
Reworked BUGS section of nmh(7) man page, and added excerpt
authorDavid Levine <levinedl@acm.org>
Mon, 26 Sep 2016 16:07:50 +0000 (12:07 -0400)
committerDavid Levine <levinedl@acm.org>
Mon, 26 Sep 2016 16:07:50 +0000 (12:07 -0400)
to end of each -help message and to end of install-mh output.

27 files changed:
etc/sendfiles
h/prototypes.h
man/nmh.man
sbr/print_help.c
test/ali/test-ali
test/anno/test-anno
test/dist/test-dist
test/folder/test-packf
test/folder/test-sortm
test/format/test-dp
test/format/test-fmtdump
test/mhfixmsg/test-mhfixmsg
test/mhical/test-mhical
test/mhmail/test-mhmail
test/mhparam/test-mhparam
test/mhpath/test-mhpath
test/mkstemp/test-mkstemp
test/post/test-sendfiles
test/prompter/test-prompter
test/rcv/test-rcvdist
test/rcv/test-rcvpack
test/rcv/test-rcvstore
test/rcv/test-rcvtty
test/repl/test-repl
test/slocal/test-slocal
uip/install-mh.c
uip/mhmail

index 85e8a49..b844a1e 100755 (executable)
@@ -32,8 +32,16 @@ finddir() {
   esac
 }
 
+help() {
+  printf '%s\n' "$usage"
+  #### Print the nmh intro text.
+  ${nmhbindir}/mhparam -help | sed -n -e '/^$/,$p'
+  exit
+}
+
 die() {
-  printf '%s\n' "$usage"; exit ${1:-1}
+  printf '%s\n' "$usage"
+  exit ${1:-1}
 }
 
 bindir=`finddir $0`
@@ -61,7 +69,7 @@ for arg in "$@"; do
     -f|-fr|-fro|-from) fromarg=1 ;;
     #### Support -gzip for backward compatibility.
     -gzip) compress=gzip ;;
-    -h|-he|-hel|-help) die 0 ;;
+    -h|-he|-hel|-help) help ;;
     #### Support -none for backward compatibility.
     -none) compress=none ;;
     -s|-su|-sub|-subj|-subje|-subjec|-subject) subjectarg=1 ;;
index bc5b6a5..a44ccbf 100644 (file)
@@ -315,6 +315,7 @@ int pidwait (pid_t, int);
 int pidstatus (int, FILE *, char *);
 char *pluspath(char *);
 void print_help (char *, struct swit *, int);
+void print_intro (FILE *, int);
 void print_sw (const char *, const struct swit *, char *, FILE *);
 void print_version (char *);
 void push (void);
index cf14330..fd18708 100644 (file)
@@ -1,4 +1,4 @@
-.TH NMH %manext7% "April 21, 2014" "%nmhversion%"
+.TH NMH %manext7% "September 26, 2016" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
@@ -134,12 +134,12 @@ ambiguity with any switches that may be added in the future, it is
 recommended that full switch names be used in durable code such as
 shell scripts, functions, and aliases.
 .PP
-All the
+Each
 .B nmh
-commands may be run with the single switch
+command may be run with the single switch
 .BR \-help ,
-which causes them to print a list of the switches they may be invoked
-with and then exit.
+which causes it to print its available switches, along with any
+profile components that apply, and then exit.
 .PP
 All the
 .B nmh
@@ -550,14 +550,21 @@ The user's nmh profile
 .IR mh-mime (7)
 .ne 4
 .SH BUGS
+\" The contents of this section also appear in sbr/print_help.c .
+Send bug reports, questions, suggestions, and patches to
+.IR nmh-workers@nongnu.org .
+That mailing list is relatively quiet, so user questions are encouraged.
+Users are also encouraged to subscribe, and view the archives, at
+https://lists.gnu.org/mailman/listinfo/nmh-workers .
+.PP
 If problems are encountered with an
 .B nmh
-program, the problems should
+program, they should
 be reported to the local maintainers of
-.BR nmh .
-When doing this, the
-name of the program should be reported, along with the version information
-for the program.
+.BR nmh ,
+if any, or to the mailing list noted above.
+When doing this, the name of the program should be reported, along
+with the version information for the program.
 .PP
 To find out what version of an
 .B nmh
@@ -570,5 +577,4 @@ the version of
 the host it was compiled on, and the date the
 program was linked.
 .PP
-Send bug reports and suggestions to
-.IR nmh-workers@nongnu.org .
+New releases and other information of potential interest are announced at http://www.nongnu.org/nmh/ .
index e045788..6853caa 100644 (file)
@@ -26,6 +26,51 @@ print_help (char *str, struct swit *swp, int print_context)
     /*
      * check if we should print any profile entries
      */
-    if (print_context && (s = context_find (invo_name)))
+    if (print_context && (s = context_find (invo_name))) {
        printf ("\nProfile: %s\n", s);
+    }
+
+    /* and for further info */
+    puts ("");
+    print_intro (stdout, TRUE);
+    puts ("\nSee the BUGS section the nmh(7) man page for more information.");
+}
+
+
+/*
+ * The text below also appears in man/nmh.man.
+ */
+
+static const char nmh_intro1[] = \
+"Send bug reports, questions, suggestions, and patches to nmh-\n"
+"workers@nongnu.org.  That mailing list is relatively quiet, so user\n"
+"questions are encouraged.  Users are also encouraged to subscribe, and\n"
+"view the archives, at https://lists.gnu.org/mailman/listinfo/nmh-\n"
+"workers .\n";
+
+/* The text below is split so that string constant length doesn't
+   exceed the C90 minimum maximum length of 509 characters. */
+static const char nmh_intro2[] = \
+"\n" \
+"If problems are encountered with an nmh program, they should be\n"
+"reported to the local maintainers of nmh, if any, or to the mailing\n"
+"list noted above.  When doing this, the name of the program should be\n"
+"reported, along with the version information for the program.\n";
+
+static const char nmh_intro3[] = \
+"\n"
+"To find out what version of an nmh program is being run, invoke the\n"
+"program with the -version switch.  This prints the version of nmh, the\n"
+"host it was compiled on, and the date the program was linked.\n"
+"\n"
+"New releases and other information of potential interest are announced\n"
+"at http://www.nongnu.org/nmh/ .\n";
+
+void
+print_intro (FILE *file, int brief) {
+    fputs (nmh_intro1, file);
+    if (! brief) {
+        fputs (nmh_intro2, file);
+        fputs (nmh_intro3, file);
+    }
 }
index 5dda0e5..6cd9d05 100755 (executable)
@@ -37,8 +37,9 @@ Usage: ali [switches] aliases ...
   -help
 EOF
 
-ali -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+ali -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `ali -v` in
index a9ad95a..6d45cac 100755 (executable)
@@ -39,7 +39,8 @@ Usage: anno [+folder] [msgs] [switches]
   -([no]p)reserve
 EOF
 
-run_prog anno -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog anno -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 5c10b17..fd0df96 100755 (executable)
@@ -71,7 +71,8 @@ Usage: dist [+folder] [msg] [switches]
   -[no]atfile
 EOF
 
-dist -help >"$actual" 2>&1
+#### Skip nmh intro text.
+dist -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index ff98cef..91c4cb5 100755 (executable)
@@ -31,7 +31,8 @@ Usage: packf [+folder] [msgs] [switches]
   -help
 EOF
 
-packf -help >"$actual" 2>&1
+#### Skip nmh intro text.
+packf -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index eef5c8a..331eae7 100755 (executable)
@@ -37,7 +37,8 @@ Usage: sortm [+folder] [msgs] [switches]
   -help
 EOF
 
-run_prog sortm -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog sortm -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index b190d73..2c5b996 100755 (executable)
@@ -36,7 +36,8 @@ Usage: dp [switches] dates ...
   -help
 EOF
 
-run_prog $dp -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog "$dp" -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 73fd14d..5c822db 100755 (executable)
@@ -35,8 +35,9 @@ Usage: fmtdump [switches]
   -help
 EOF
 
-$fmtdump -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+"$fmtdump" -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `$fmtdump -v` in
index 81d4796..fb9b945 100755 (executable)
@@ -70,7 +70,8 @@ Usage: mhfixmsg [+folder] [msgs] [switches]
   -help
 EOF
 
-run_prog mhfixmsg -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog mhfixmsg -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 
index fb80250..af75cf8 100755 (executable)
@@ -46,7 +46,8 @@ Usage: mhical [switches]
   -help
 EOF
 
-run_prog mhical -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog mhical -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 
index ff9fd40..4d127e4 100755 (executable)
@@ -88,8 +88,9 @@ Usage: mhmail [-t(o)] addrs ... [switches]
   mhmail with no arguments is equivalent to inc
 EOF
 
-mhmail -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+mhmail -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 
 # check -version
index 29dd11f..72cb397 100755 (executable)
@@ -33,8 +33,9 @@ Usage: mhparam [profile-components] [switches]
   -(debug)
 EOF
 
-mhparam -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+mhparam -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `mhparam -v` in
index a4b621b..cf2ab5d 100755 (executable)
@@ -28,8 +28,9 @@ Usage: mhpath [+folder] [msgs] [switches]
   -help
 EOF
 
-run_prog mhpath -help > $actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog mhpath -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `mhpath -v` in
index 084f649..94ce056 100755 (executable)
@@ -47,8 +47,9 @@ else
        EOF
 fi
 
-$mkstemp -h >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog $mkstemp -h | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 
 # check -version
index 64bf269..64ccd5e 100755 (executable)
@@ -89,7 +89,8 @@ Usage: sendfiles [switches] -to recipient -subject subject file1 [file2 ...]
   Can use PERSON environment variable instead of -from switch.
 EOF
 
-run_prog sendfiles -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog sendfiles -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 9a25bc0..704f998 100755 (executable)
@@ -35,8 +35,9 @@ Usage: prompter [switches] file
   -help
 EOF
 
-run_prog prompter -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog prompter -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `prompter -v` in
index eca9686..720b1bf 100755 (executable)
@@ -32,7 +32,8 @@ Usage: rcvdist [switches] [switches for postproc] address ...
   -help
 EOF
 
-run_prog $rcvdist -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog "$rcvdist" -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 958504c..15272af 100755 (executable)
@@ -33,7 +33,8 @@ Usage: rcvpack [switches] file
   -help
 EOF
 
-run_prog $rcvpack -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog "$rcvpack" -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 9656f37..0f0ab0f 100755 (executable)
@@ -38,8 +38,9 @@ Usage: rcvstore [+folder] [switches]
   -help
 EOF
 
-run_prog $rcvstore -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog "$rcvstore" -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `$rcvstore -v` in
index f0e6558..800d0fb 100755 (executable)
@@ -37,7 +37,8 @@ Usage: rcvtty [command ...]
   -help
 EOF
 
-run_prog $rcvtty -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog "$rcvtty" -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 20bb96d..6beea72 100755 (executable)
@@ -55,8 +55,9 @@ Usage: repl: [+folder] [msg] [switches]
   -nofmtproc
 EOF
 
-run_prog repl -help >$actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog repl -help | sed '/^$/Q' >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `repl -v` in
index 3fb73b2..800a16f 100755 (executable)
@@ -42,7 +42,8 @@ Usage: slocal [switches]
   -help
 EOF
 
-run_prog $slocal -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog $slocal -help | sed '/^$/Q' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
index 627c48e..b327115 100644 (file)
@@ -219,6 +219,10 @@ query:
            fprintf (out, "%s: %s\n", np->n_name, np->n_field);
     }
     fclose (out);
+
+    puts ("\nPlease see the nmh(7) man page for an introduction to nmh.\n");
+    print_intro (stdout, FALSE);
+
     done (0);
     return 1;
 }
index c43f9c3..2769570 100755 (executable)
@@ -48,6 +48,13 @@ finddir() {
   esac
 }
 
+help() {
+  printf '%s\n' "$usage"
+  #### Print the nmh intro text.
+  ${nmhbindir}/mhparam -help | sed -n -e '/^$/,$p'
+  exit
+}
+
 #### Convenience function to allow concise code below.
 die() {
     [ $# -gt 0 ]  &&  printf '%s\n' "$1" >&2
@@ -127,7 +134,7 @@ for arg in "$@"; do
     -f|-fr|-fro|-from) mhmailswitch=1; fromarg=1 ;;
     -hea|-head|-heade|-header|-headerf|-headerfi|-headerfie|-headerfiel|\
 -headerfield) mhmailswitch=1; headerfieldarg=1 ;;
-    -hel|-help) printf '%s\n' "$usage"; exit ;;
+    -hel|-help) help ;;
     -nose|-nosen|-nosend) mhmailswitch=1; sendsw=0 ;;
     -p|-pr|-pro|-prof|-profi|-profil|-profile) mhmailswitch=1; use_send=1 ;;
     -resend) die 'mhmail: did you mean -resent instead of -resend?' ;;