[GRASS-user] r.patch example in the manual

Glynn Clements glynn at gclements.plus.com
Tue Dec 18 12:57:58 EST 2007


[CC to grass-dev]

Hamish wrote:

> > I notice the "pattern" option to g.mlist has been shortened to "pat"
> > and the "input" and "output" options to gdal sometimes get shortened
> > to "in" and "out". Is there a rule one can apply for shortening these
> > options and do all GRASS modules understand the short options?
> 
> Yes; added as new FAQ entry:
>   http://grass.gdf-hannover.de/wiki/Module_command_line_parser
> 
> 
>     * Option names may be shortened up to the point where they collide.
> Thus shortening option names in a module with color= and column=
> options would require at minimum colo= and colu=. 
> 
> for example:
>   input= -> in=   and   output= -> out=

However, module authors sometimes abbreviate the actual option name. 
E.g. "g.mlist sep=".

In general, this is a bad idea; if the option name is spelled in full,
the user can choose to abbreviate it or not. If the the option name
itself is abbreviated, the user has no choice.

The only case where modules should abbreviate option names is if the
abbreviation isn't a strict prefix of the full name. This usually
corresponds to an option name comprised of multiple words, where the
first word is abbreviated, e.g. "fcolor" is an abbreviation of
"foreground color" but isn't a prefix of it.

It wouldn't be that hard to allow option names to be defined as e.g. 
fore_ground_color, and support any combination of prefixes, e.g. fore,
fg, fcol, fgcol, forecol etc. The main issue is whether you would get
unexpected conflicts.

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


More information about the grass-user mailing list