[GRASS-dev] Re: [GRASS GIS] #1031: More specific parameter information in command line help

GRASS GIS trac at osgeo.org
Tue Apr 13 09:56:11 EDT 2010


#1031: More specific parameter information in command line help
--------------------------+-------------------------------------------------
  Reporter:  huhabla      |       Owner:  grass-dev at lists.osgeo.org
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  7.0.0                    
 Component:  libgis       |     Version:  svn-trunk                
Resolution:               |    Keywords:  parser, help             
  Platform:  All          |         Cpu:  All                      
--------------------------+-------------------------------------------------
Comment (by martinl):

 Replying to [comment:6 glynn]:
 > Replying to [comment:5 huhabla]:
 > > I have attached a patch for lib/gis/parser_help.c and
 lib/gis/parser_stanndard_options.c which implements the discussed ideas.
 >
 > 1. The patch makes unnecessary formatting changes, which also contravene
 the GRASS formatting conventions. In general, formatting changes should be
 kept separate from other changes to make it easier to review the substance
 of the changes. But in this case, the formatting changes just shouldn't be
 there.
 >
 > 2. The updated output is unnecessarily verbose, which is a bad thing
 IMHO. The "required" and "multiple" status can already be determined from
 the "Usage:" section. Non-required options are listed in square brackets,
 while multiple options use the "option=value,..." convention. If you
 really want this format, it should be a separate option, e.g. --verbose-
 help.

 Probably we should think about the optimalization of the attributes in
 struct Option (1) Currently we have:

 {{{
 struct Option
 {
     const char *key;
     int type;
     int required;
     int multiple;
     const char *options;
     const char **opts;
     const char *key_desc;
     const char *label;
     const char *description;
     const char *descriptions;
     const char **descs;
     char *answer;
     const char *def;
     char **answers;
     struct Option *next_opt;
     const char *gisprompt;
     const char *guisection;
     const char *guidependency;
     int (*checker) ();
     int count;
 };
 }}}

 Parsed for wxGUI, e.g.
 {{{
 {'gisprompt': True, 'multiple': 'no', 'description': 'Name for output
 vector map', 'guidependency': '', 'default': '', 'age': 'new', 'required':
 'yes', 'value': 'lakes_buff', 'label': '', 'guisection': u'Required',
 'key_desc': ['name'], 'values': [], 'values_desc': [], 'prompt': 'vector',
 'wxId': [-327], 'element': 'vector', 'type': 'string', 'name': 'output'}
 }}}

 I would suggest:

  * if 'key_desc' is NULL then use as 'key_desc' 'prompt' value
  * do we need 'element' attribute - it could be probably replaced by
 'prompt'
  * suggested 'status' info is determined from 'prompt' and 'age'
 attribute.

 (1)
 http://download.osgeo.org/grass/grass7_progman/gislib.html#Complete_Structure_Members_Table

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1031#comment:7>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list