to end of each -help message and to end of install-mh output.
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`
-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 ;;
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);
-.TH NMH %manext7% "April 21, 2014" "%nmhversion%"
+.TH NMH %manext7% "September 26, 2016" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
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
.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
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/ .
/*
* 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);
+ }
}
-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
-([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
-[no]atfile
EOF
-dist -help >"$actual" 2>&1
+#### Skip nmh intro text.
+dist -help | sed '/^$/Q' >"$actual" 2>&1
check "$expected" "$actual"
# check -version
-help
EOF
-packf -help >"$actual" 2>&1
+#### Skip nmh intro text.
+packf -help | sed '/^$/Q' >"$actual" 2>&1
check "$expected" "$actual"
# check -version
-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
-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
-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
-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"
-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"
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
-(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
-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
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
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
-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
-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
-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
-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
-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
-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
-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
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;
}
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
-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?' ;;