]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/sbr/RCS/help.c,v
Always check that mktemp()/mktemp2() succeeds before trying to
[nmh] / docs / historical / mh-6.8.5 / sbr / RCS / help.c,v
1 head 1.4;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.4
9 date 94.04.21.19.56.24; author jromine; state Exp;
10 branches;
11 next 1.3;
12
13 1.3
14 date 92.12.15.00.20.22; author jromine; state Exp;
15 branches;
16 next 1.2;
17
18 1.2
19 date 92.01.25.01.19.05; author jromine; state Exp;
20 branches;
21 next 1.1;
22
23 1.1
24 date 92.01.25.01.14.58; author jromine; state Exp;
25 branches;
26 next ;
27
28
29 desc
30 @@
31
32
33 1.4
34 log
35 @print default options in help
36 @
37 text
38 @/* help.c - print the usage line */
39 #ifndef lint
40 static char ident[] = "@@(#)$Id: help.c,v 1.3 1992/12/15 00:20:22 jromine Exp jromine $";
41 #endif /* lint */
42
43 #include "../h/mh.h"
44 #include <stdio.h>
45
46
47 extern char *options[];
48
49
50 void help (str, swp)
51 register char *str;
52 register struct swit *swp;
53 {
54 int nameoutput,
55 len,
56 linepos,
57 outputlinelen;
58 register char *cp,
59 **ap;
60
61 printf ("syntax: %s\n", str);
62 printf (" switches are:\n");
63 printsw (ALL, swp, "-");
64 if ((cp = m_find (invo_name)) != NULL)
65 printf ("profile: %s\n", cp);
66
67 if (ssequal ("@@(#)", cp = version))
68 cp += 4;
69 printf ("\nversion: %s\n", cp);
70
71 nameoutput = linepos = 0;
72 outputlinelen = OUTPUTLINELEN;
73 for (ap = options; *ap; ap++) {
74 if (!nameoutput) {
75 fprintf (stdout, "%s: ", cp = "options");
76 linepos += (nameoutput = strlen (cp) + 2);
77 }
78 len = strlen (cp = *ap);
79 if (linepos != nameoutput)
80 if (len + linepos + 3 > outputlinelen)
81 fprintf (stdout, "\n%*s", linepos = nameoutput, "");
82 else {
83 fputs (" ", stdout);
84 linepos++;
85 }
86 fprintf (stdout, "[%s]", cp);
87 linepos += len + 2;
88 }
89
90 if (linepos)
91 (void) fputc ('\n', stdout);
92 }
93 @
94
95
96 1.3
97 log
98 @endif sugar
99 @
100 text
101 @d3 1
102 a3 1
103 static char ident[] = "@@(#)$Id: help.c,v 1.2 1992/01/25 01:19:05 jromine Exp jromine $";
104 d27 2
105 @
106
107
108 1.2
109 log
110 @add id,
111 check version for @@(#)
112 @
113 text
114 @d3 2
115 a4 2
116 static char ident[] = "@@(#)$Id: formatsbr.c,v 1.14 1992/01/24 18:09:25 jromine Exp $";
117 #endif lint
118 @
119
120
121 1.1
122 log
123 @Initial revision
124 @
125 text
126 @d2 3
127 d28 3
128 a30 1
129 printf ("\nversion: %s\n", version);
130 @