On Sat, Sep 30, 2006 at 06:19:16PM +0200, Han Boetes wrote:
>
> That's what was in the original manpage, but I'm not looking to
> repeat it. I want to properly indicate that this is ok:
>
> spamprobe auto-train SPAM foofile
> spamprobe auto-train GOOD barfile
> spamprobe auto-train SPAM foofile GOOD barfile
>
> And I can't find an example of a program which uses similar
> syntax. How would you do this?
>
well, there is a trade off: precision vs. simplicity (readability)
if you want to be 100% correct, you simply need to list every possible
combination, as you have above (i.e. 3 synopses).
personally i prefer to simplify things, and then document the missing
bits. otherwise SYNOPSIS gets horrible. so for your example:
spamprobe auto-train [SPAM file...] [GOOD file ...]
in mdoc:
.Nm spamprobe
.Cm auto-train
.Op Cm SPAM Ar
.Op Cm GOOD Ar
i would probably then document that at least one must be specified.
if you get the options list correct, it will be obvious to readers.
so you will have...
-a blah
-b blah
SPAM file blah
At least one of SPAM or GOOD must be specified.
GOOD file blah
At least one of SPAM or GOOD must be specified.
also there's a lot of different ways you could show it...you just have
to decide which you like best, which is easiest to explain, ...
jmc