head 1.4; access; symbols; locks; strict; comment @ * @; 1.4 date 94.04.21.19.56.24; author jromine; state Exp; branches; next 1.3; 1.3 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.2; 1.2 date 92.01.25.01.19.05; author jromine; state Exp; branches; next 1.1; 1.1 date 92.01.25.01.14.58; author jromine; state Exp; branches; next ; desc @@ 1.4 log @print default options in help @ text @/* help.c - print the usage line */ #ifndef lint static char ident[] = "@@(#)$Id: help.c,v 1.3 1992/12/15 00:20:22 jromine Exp jromine $"; #endif /* lint */ #include "../h/mh.h" #include extern char *options[]; void help (str, swp) register char *str; register struct swit *swp; { int nameoutput, len, linepos, outputlinelen; register char *cp, **ap; printf ("syntax: %s\n", str); printf (" switches are:\n"); printsw (ALL, swp, "-"); if ((cp = m_find (invo_name)) != NULL) printf ("profile: %s\n", cp); if (ssequal ("@@(#)", cp = version)) cp += 4; printf ("\nversion: %s\n", cp); nameoutput = linepos = 0; outputlinelen = OUTPUTLINELEN; for (ap = options; *ap; ap++) { if (!nameoutput) { fprintf (stdout, "%s: ", cp = "options"); linepos += (nameoutput = strlen (cp) + 2); } len = strlen (cp = *ap); if (linepos != nameoutput) if (len + linepos + 3 > outputlinelen) fprintf (stdout, "\n%*s", linepos = nameoutput, ""); else { fputs (" ", stdout); linepos++; } fprintf (stdout, "[%s]", cp); linepos += len + 2; } if (linepos) (void) fputc ('\n', stdout); } @ 1.3 log @endif sugar @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: help.c,v 1.2 1992/01/25 01:19:05 jromine Exp jromine $"; d27 2 @ 1.2 log @add id, check version for @@(#) @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: formatsbr.c,v 1.14 1992/01/24 18:09:25 jromine Exp $"; #endif lint @ 1.1 log @Initial revision @ text @d2 3 d28 3 a30 1 printf ("\nversion: %s\n", version); @