1 /* usage.c: Output a help message (from help.h).
2 
3    Modified in 2001 by O. Weber.
4    Written in 1995 by K. Berry.  Public domain.  */
5 
6 #include <w2c/config.h>
7 
8 /* Call usage if the program exits with an "usage error".  STR is supposed
9    to be the program name. */
10 
11 void
usage(const_string str)12 usage (const_string str)
13 {
14   fprintf (stderr, "Try `%s --help' for more information.\n", str);
15   uexit (1);
16 }
17 
18 /* Call usage if the program exits by printing the help message.
19    MESSAGE is a NULL-terminated array of strings which make up the
20    help message.  Each string is printed on a separate line.
21    We use arrays instead of a single string to work around compiler
22    limitations (sigh).
23 */
24 void
usagehelp(const_string * message,const_string bug_email)25 usagehelp (const_string *message, const_string bug_email)
26 {
27     if (!bug_email)
28         bug_email = "tex-k@tug.org";
29     while (*message) {
30         printf("%s\n", *message);
31         ++message;
32     }
33     printf("\nEmail bug reports to %s.\n", bug_email);
34     uexit(0);
35 }
36