]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/sbr/help.c
1 /* help.c - print the usage line */
3 static char ident
[] = "@(#)$Id: help.c,v 1.4 1994/04/21 19:56:24 jromine Exp $";
10 extern char *options
[];
15 register struct swit
*swp
;
24 printf ("syntax: %s\n", str
);
25 printf (" switches are:\n");
26 printsw (ALL
, swp
, "-");
27 if ((cp
= m_find (invo_name
)) != NULL
)
28 printf ("profile: %s\n", cp
);
30 if (ssequal ("@(#)", cp
= version
))
32 printf ("\nversion: %s\n", cp
);
34 nameoutput
= linepos
= 0;
35 outputlinelen
= OUTPUTLINELEN
;
36 for (ap
= options
; *ap
; ap
++) {
38 fprintf (stdout
, "%s: ", cp
= "options");
39 linepos
+= (nameoutput
= strlen (cp
) + 2);
41 len
= strlen (cp
= *ap
);
42 if (linepos
!= nameoutput
)
43 if (len
+ linepos
+ 3 > outputlinelen
)
44 fprintf (stdout
, "\n%*s", linepos
= nameoutput
, "");
49 fprintf (stdout
, "[%s]", cp
);
54 (void) fputc ('\n', stdout
);