File: print_help.c

package info (click to toggle)
nmh 1.8-4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,860 kB
  • sloc: ansic: 50,445; sh: 22,697; makefile: 1,138; lex: 740; perl: 509; yacc: 265
file content (78 lines) | stat: -rw-r--r-- 2,347 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* print_help.c -- print a help message, and possibly the
 *              -- profile/context entries for this command
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include "h/mh.h"
#include "context_find.h"
#include "print_sw.h"
#include "print_help.h"
#include "globals.h"


void
print_help (char *str, struct swit *swp, int print_context)
{
    char *s;

    /* print Usage string */
    printf ("Usage: %s\n", str);

    /* print all the switches */
    puts("  switches are:");
    print_sw("", swp, "-", stdout);

    /*
     * check if we should print any profile entries
     */
    if (print_context && (s = context_find (invo_name))) {
	printf ("\nProfile: %s\n", s);
    }

    /* and for further info */
    putchar('\n');
    print_intro (stdout, true);
    puts ("\nSee the BUGS section of nmh(7) 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\n"
"nmh-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-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, bool brief)
{
    fputs (nmh_intro1, file);
    if (! brief) {
        fputs (nmh_intro2, file);
        fputs (nmh_intro3, file);
    }
}