[GRASS-dev] grass7 - renamed optiont

Glynn Clements glynn at gclements.plus.com
Sun Jun 12 03:03:47 EDT 2011


Helena Mitasova wrote:

> In grass7 the names of options for some commands were changed 
> (but the manuals were not updated).
> http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures#Renamedoptions
> 
> I would like to update the manuals for r.flow, r.sim.water and r.sim.sediment, 
> to reflect the change but first I would like to ask - is this change really necessary?

Yes. And we there are probably some more which should be changed (and
some of those listed on that page should be changed further).

In general: consistency is good, abbreviations are bad. And 7.0
provides an opportunity to fix past mistakes.

> If yes, I would like to change the two last options to more meaningful terms as follows:

> dsout -> density --> accumulation (or just accum?)

There is no reason to abbreviate an option name. The parser recognises
abbreviations provided that they are unambiguous, but it won't
recognise an unabbreviated name if the option name itself is
abbreviated.

7.0 takes this a step further: if an option name consists of multiple
words separated by underscores, you can abbreviate or omit individual
words and/or omit the underscores; e.g. an option named "levels_red"
could be abbreviated to "lev_red", "lev_r", or even just "lr".

So there shouldn't be any need to use abbreviations when choosing
option names. In some cases, it may be worth adding underscores
between the lexemes of compound words in order to facilitate
abbreviation.

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.

For this reason, no option should be a prefix of another. So instead
of e.g. "red" and "red_levels" (which would make "r=..." ambiguous),
the latter becomes "levels_red".

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


More information about the grass-dev mailing list