On Mon, Aug 16, 2021 at 01:45:30PM +0200, Ingo Schwarze wrote:
> Hi Jason,
> 
> Jason McIntyre wrote on Mon, Aug 16, 2021 at 12:02:13PM +0100:
> 
> > when i wrote my mail, i failed to understand that "overrides earlier"
> > was really just another way of saying "mutually exclusive".
> 
> That is incorrect.
> 
> This is what "mutually exclusive" means (without further qualification):
> 
>    $ frob -f -u
>   usage: frob [-f | -u]
> 
> This is what "overrides earlier" means:
> 
>    $ frob -f -u
>   output from successful unfrobnification
> 
>    $ frob -u -f
>   output from successful frobnification
> 

for me, mututally exclusive means simply that you can;t use the options 
together.
it doesn;t specify how a program reacts:

- sometimes the program coughs when you use them together (spits out usage)
- sometimes it just uses the last match (so silently accepts both; first/last 
wins)

maybe others do not see it that way. i mean, i'm not saying i'm correct,
only that this is how i understand the concept.

> > i don;t find it as clear, and i don;t hugely like it, but i guess
> > it's just my preference.
> > 
> > i also dislike the sentence structure of "Overrides earlier -f."
> > although it's understandable, it reads like there's a word or phrase
> > missing.
> 
> Yes, it is an elliptic wording.
> 
> > Overrides earlier instances of -f. Overrides previous -f options.
> 
> Both are still elliptic.
> 
> The intended meaning of the ellipsis is:
> 
>   [This option] overrides [any] earlier -f [options].
> 

yes, i understand about elliptic wording. what i meant was that i felt
this form (i.e. elliptic) read badly.

> Should we prefer the non-elliptic wording?
> 

well, for me, yes. but i guess other people will prefer the shorter
text.

> > i just find it clearer when we just say -x and -y are mutually exclusive.
> 
> OK, let's spell this out in full.
> 
> I'm aware of two ways to document "mutually exclusive":
> 
>   -f   Frobnicate.  Mutually exclusive with -u.
>   -u   Unfrobnicate.  Mutually exclusive with -f.
> 
> Or:
> 
>   -f   Frobnicate.
>   -u   Unfrobnicate.
>   [...]
>   The options -f and -u are mutually exclusive.
> 
> I have no strong preference either way because if a user specifies both,
> they get the usage() message, so the error is likely to be discovered
> either way.
> 

well when you have 10 exclusive options (looking at you, ls(1)) then
adding the text to every option becomes unwieldy. that's why we did it
the second way. but when you just have a couple (much more common) then
it can be easier to read in your first example.

> 
> I'm aware of two ways to document "overrides":
> 
>   -f   Frobnicate.  Overrides earlier -u.
>   -u   Unfrobnicate.  Overrides earlier -f.
> 
> Or:
> 
>   -f   Frobnicate.
>   -u   Unfrobnicate.
>   [...]
>   The options -f and -u override each other [and the action
>   is determined by the last one specified].
> 
> I prefer the the former because the latter is easy to miss (in
> addition to being longer), and there is no error message to tell
> the user that *something* is going on.
> 
> 
> Some pages use
> 
>   The options -f and -u are mutually exclusive and override each other.
> 
> as a synonym for
> 
>   The options -f and -u override each other.
> 
> That may have caused your confusion.  Arguably, it might be better
> to avoid the somewhat redundant and potentially confusing wording
> "are mutually exclusive and override each other".  Do you agree?
> 
> Yours,
>   Ingo

well, in those cases i think the authors shared the viewpoint that
mutually exclusive means you can;t mix them but in this case it is
essentially not an error to do so, and so documented it that way.

maybe it is more helpful to think of "mutually exclusive" as "causes an
error", but i am not sure.

jmc

Reply via email to