| 1 |
.de Op |
| 2 |
. |
| 3 |
.\" If first arg is "=", set the option list. If it's "+", add to the list. |
| 4 |
.\" Otherwise, this marks an optional section. If none of the arguments are |
| 5 |
.\" in the option list, we ignore the section, to the next .Op call. |
| 6 |
. |
| 7 |
. ie '\\$1'=' \{. |
| 8 |
. ds Ol \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 |
| 9 |
. \} |
| 10 |
. el .ie '\\$1'+' \{. |
| 11 |
. as Ol \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 |
| 12 |
. \} |
| 13 |
. el .ie '\\$2'-' \{. |
| 14 |
. nr x 0 |
| 15 |
. Ox "\\$1" \\*(Ol |
| 16 |
. if \\nx \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 |
| 17 |
. \} |
| 18 |
. el .if \\n(.$>0 \{. |
| 19 |
. ie '\\*(Ol'' .nr x 1 |
| 20 |
. el .nr x 0 |
| 21 |
. if \\nx=0&(\\n(.$>=1) .Ox \\$1 \\*(Ol |
| 22 |
. if \\nx=0&(\\n(.$>=2) .Ox \\$2 \\*(Ol |
| 23 |
. if \\nx=0&(\\n(.$>=3) .Ox \\$3 \\*(Ol |
| 24 |
. if \\nx=0&(\\n(.$>=4) .Ox \\$4 \\*(Ol |
| 25 |
. if \\nx=0&(\\n(.$>=5) .Ox \\$5 \\*(Ol |
| 26 |
. if \\nx=0&(\\n(.$>=6) .Ox \\$6 \\*(Ol |
| 27 |
. if \\nx=0&(\\n(.$>=7) .Ox \\$7 \\*(Ol |
| 28 |
. if \\nx=0&(\\n(.$>=8) .Ox \\$8 \\*(Ol |
| 29 |
. if \\nx=0&(\\n(.$>=9) .Ox \\$9 \\*(Ol |
| 30 |
. if \\nx=0 .ig Op |
| 31 |
. \} |
| 32 |
.. |
| 33 |
. |
| 34 |
.de Ox |
| 35 |
. |
| 36 |
.\" The first argument is the option we are looking for, and the remaining |
| 37 |
.\" arguments are the option list we should look in. If the first arg |
| 38 |
.\" matches the second, which is the start of the option list, we have |
| 39 |
.\" a match. Otherwise, if there is a third argument, call ourself again |
| 40 |
.\" with that one shifted over into the $2 slot to check it, and so on, |
| 41 |
.\" shifting over again until we have worked our way through the entire |
| 42 |
.\" option list. |
| 43 |
. |
| 44 |
. ie '\\$1'\\$2' .nr x 1 |
| 45 |
. el .if \\n(.$>=3 .Ox \\$1 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 |
| 46 |
.. |