1 /* printsw.c - print switches */
6 void printsw (substr, swp, prefix)
9 register struct swit *swp;
19 len = strlen (substr);
20 for (; swp -> sw; swp++) {
21 if (!*substr || /* null matches all strings */
22 (ssequal (substr, swp -> sw) && len >= swp -> minchars)) {
24 if (sp = (&swp[1]) -> sw) /* next switch */
25 if (!*substr && sp[0] == 'n' && sp[1] == 'o' &&
26 strcmp (&sp[2], swp -> sw) == 0 && (
27 ((&swp[1]) -> minchars == 0 && swp -> minchars == 0) ||
28 ((&swp[1]) -> minchars == (swp -> minchars) + 2)))
30 if (swp -> minchars > 0) {
34 (void) strcpy (cp, "[no]");
37 for (cp1 = swp -> sw, i = 0; i < swp -> minchars; i++)
40 while (*cp++ = *cp1++);
41 printf (" %s%s\n", prefix, buf);
44 if (swp -> minchars == 0)
45 printf (optno ? " %s[no]%s\n" : " %s%s\n",
48 swp++; /* skip -noswitch */