[GRASS-dev] g.mapsets revision 30712

Glynn Clements glynn at gclements.plus.com
Fri Apr 4 23:03:05 EDT 2008


Hamish wrote:

> > Also, I'm not sure what the policy is (or even if there is a policy)
> > on using abbreviations in option names. For a single word, it's normal
> > to used the complete word, as option names can be abbreviated. For
> > multiple words, it's more awkward.
> 
> I expect understanding options for non-English speakers is hard enough,
> trying to decipher abbreviated English option names would be much worse.
> IMO underscores are nice between words for readability, but which ever
> way is chosen, consistency is more important.

I would have added the underscore, but addmapset= didn't have it.

I have been wondering whether it would be worth crafting an algorithm
which can handle abbreviating multi-word options. E.g. if the option
was named remove_map_set, you could use any combination of prefixes,
e.g. rem, rms, remms, etc. That should eliminate the need to use
abbreviations in option names.

> Lower case seems to be standard for options (exception: r.terraflow [fix
> for GRASS 7])
> There are some old modules (r.stats) which use upper case for flags.

That's consistent with most other programs. E.g. programs which use
getopt_long() normally use lower case for --long-options and both
lower and upper case for single-character switches (particularly if
there are a lot of them).

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


More information about the grass-dev mailing list