[GRASS5] g.region G_usage() commented out?

Glynn Clements glynn.clements at virgin.net
Tue May 14 13:12:44 EDT 2002


Russell Nelson wrote:

> The inter version of g.region has a call to G_usage() in die()
> commented out.

die() is in the "cmd" version of g.region, not the "inter" version.

> Anybody know why this might be? 

There is seldom any point in calling G_usage() directly. G_usage()
generates a usage message based upon the options and flags which have
been defined by G_define_option() and G_define_flag() respectively.

G_parser() will call G_usage() if it detects an error (a required
option wasn't specified, an unknown option was specified, etc), or if
the "help" option was given. If G_parser() indicates success, the
nature of any remaining errors is such that G_usage() is unlikely to
provide any meaningful clues.

> Telling somebody that 
> something is an "** illegal value **" is almost completely useless to
> them.  Much better to explain what change is necessary to bring the
> value within bounds.

If die() is called, the error is that one of the values isn't in a
suitable format; G_usage() won't help here. The set of supported
variations is sufficiently large that it probably isn't sensible to
document them within the usage message.

However, the manual page should mention the fact that, for lat/lon
locations, values have to be in DMS. But it doesn't.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list