[GRASS-dev] [GRASS GIS] #2409: last call for options keys consolidation

GRASS GIS trac at osgeo.org
Thu Dec 18 09:02:28 PST 2014


#2409: last call for options keys consolidation
----------------------------------+-----------------------------------------
 Reporter:  martinl               |       Owner:  grass-dev@…              
     Type:  task                  |      Status:  new                      
 Priority:  blocker               |   Milestone:  7.0.0                    
Component:  Default               |     Version:  unspecified              
 Keywords:  standardized options  |    Platform:  Unspecified              
      Cpu:  Unspecified           |  
----------------------------------+-----------------------------------------

Comment(by hcho):

 Replying to [comment:136 hcho]:
 > Replying to [comment:133 glynn]:
 > > Replying to [comment:131 hcho]:
 > >
 > > > * modules with parameters `raster_map=` and `raster_map_2=`: `rast`
 ambiguous, `rmap` for `raster_map=` and `rmap2` for `raster_map_2=`
 > > >
 > > > * modules with parameters `raster_map=` and `raster_map2=`: `rast`
 ambiguous, `rmap` for `raster_map=` and `rmap2` for `raster_map2=`
 > > >
 > > > I'm not sure if I was clear enough here.
 > >
 > > You're suggesting that the abbreviation must include some part of the
 last word of the option name? Or that it must include the last character?
 I.e. is rm= ambiguous?
 >
 > No, not the last word of the option name. You cannot skip any words
 separated by an underscore. rm= is not ambiguous in this case because the
 shortest option name that matches rm= is raster_map=. If one wants
 raster_map2=, use rmap2=, not rm2= (no abbreviation inside a word).
 >

 I mean the shortest option name with no more following underscores. 'r'
 for raster, 'm' for map, and no more underscores after 'raster_map'.

 If you have `raster_map_1=` and `raster_map_2=`, `rm=` would be ambiguous
 because `raster_map` is still ambiguous. If you have `raster_map=` and
 `raster_map_2=`, `rm=` expands to `raster_map=` and it's not ambiguous.

 > >
 > > The main problems I foresee with that are
 > >
 > >  * The last word (or an abbreviation of it) might match some earlier
 portion of the option name, meaning that the user intended to specify
 (part of) the last word but the characters were matched against an earlier
 portion.
 > >
 >
 > I'm not talking about skipping words and using the last word, so this is
 not the case.
 >
 > >  * It's possible for a string to match the last word of multiple
 options. E.g. given options raster_map and raster_2_map, rmap would match
 both equally.
 >
 > rmap= would match raster_map= "only" because you cannot skip 2.
 >
 > Hope I'm clearer now.

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



More information about the grass-dev mailing list