[GRASS-dev] grass7 - renamed optiont

Glynn Clements glynn at gclements.plus.com
Wed Jun 15 02:40:12 EDT 2011


Hamish wrote:

> > The only caveat is that an abbreviation given on the command line must
> > not match multiple options, or else an error occurs; there is no "best
> > match" rule.
> 
> I would think that an exact match should trump all others,

It does. Otherwise there wouldn't be any way to enter an option which
was a prefix of another, as it would always be ambiguous. An exact
match terminates the loop (ignoring any future matches) and sets the
match count to one (ignoring any prior matches).

But if one option is a prefix of another, it cannot be abbreviated, as
that would always result in multiple inexact matches, which triggers
the ambiguity error. That's the case in both 6.x and 7.0.

It wouldn't be particularly hard to treat this situation as a special
case, but I'm not sure it's wise. The user may have overlooked the
shorter option and be intending to abbreviate the longer one. Of
course, that could also be true for an exact match, but there's not
much that we can about it; there has to be some way to specify the
shorter option.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list