3 * print_sw.c -- print switches
12 print_sw (char *substr, struct swit *swp, char *prefix)
16 register char *cp, *cp1, *sp;
20 for (; swp->sw; swp++) {
21 /* null matches all strings */
22 if (!*substr || (ssequal (substr, swp->sw) && len >= swp->minchars)) {
25 if ((sp = (&swp[1])->sw)) {
26 if (!*substr && sp[0] == 'n' && sp[1] == 'o' &&
27 strcmp (&sp[2], swp->sw) == 0 && (
28 ((&swp[1])->minchars == 0 && swp->minchars == 0) ||
29 ((&swp[1])->minchars == (swp->minchars) + 2)))
33 if (swp->minchars > 0) {
40 for (cp1 = swp->sw, i = 0; i < swp->minchars; i++)
43 while ((*cp++ = *cp1++));
44 printf (" %s%s\n", prefix, buf);
47 printf(optno ? " %s[no]%s\n" : " %s%s\n", prefix, swp->sw);
50 swp++; /* skip -noswitch */