[GRASS-dev] [GRASS GIS] #2228: g.mremove: add an option to use 'map name exclusion patterns' like is available in g.mlist

GRASS GIS trac at osgeo.org
Sat May 31 04:12:06 PDT 2014


#2228: g.mremove: add an option to use 'map name exclusion patterns' like is
available in g.mlist
--------------------------------------------------------------+-------------
 Reporter:  pvanbosgeo                                        |       Owner:  grass-dev@…              
     Type:  enhancement                                       |      Status:  new                      
 Priority:  normal                                            |   Milestone:  7.0.0                    
Component:  Default                                           |     Version:  svn-trunk                
 Keywords:  g.mlist, g.list, g.mremove, g.mremove, interface  |    Platform:  All                      
      Cpu:  All                                               |  
--------------------------------------------------------------+-------------
Changes (by wenzeslaus):

  * keywords:  => g.mlist, g.list, g.mremove, g.mremove, interface


Comment:

 I'm not able to inspect the patch but I tried to write a basic test for
 it. See the attachment. You can run it inside a sample NC location in
 user1 mapset using:
 {{{
 python test_g_mremove.py --verbose
 }}}
 Feel free to contribute more test cases if you have ideas.


 Also, I just noticed that Luca actually wanted the g.mremove interface for
 g.mlist and for a moment I though I too but than I remembered that this
 this was already discussed on grass-dev with a clear result, so adding the
 main points here too.

 [http://lists.osgeo.org/pipermail/grass-dev/2014-May/068595.html
 g.mremove: adding 'map name exclusion pattern' option] (Huidae Cho):
 {{{
 The g.mremove interface looks convenient, but can be dangerous...
 ...deleted my raster files by using the
 positional parameter thing while trying to delete all my temporary
 vectors.
     g.mremove tmp*
 Did I want to delete tmp* rasters or vectors? I forgot to add vect=
 and my tmp* rasters were listed. Thanks to the -f option.

 ... Also, if we want
 to add the exclude= parameter to g.mremove, it's not just one but 12
 because there are 12 data types and pattern parameters...
 }}}

 [http://lists.osgeo.org/pipermail/grass-dev/2008-October/040506.html
 g.mlist syntax vs g.mremove syntax] (Glynn Clements):
 {{{
 ...it's g.mremove (and g.remove, g.copy, g.rename)
 which got it wrong. I'm aware that having a separate option for each
 type means less typing, but...
 the g.list/g.mlist interface makes for a smaller (and arguably
 simpler) GUI dialog.

 ...g.mremove interface is basically a fudge to get
 around the restriction that the parser only allows a single
 "positional" parameter, and requires keywords for the rest. You can't
 just use e.g.:
     g.mlist rast gpcp_1dd_p1d.*.*
 but you can "fudge" it to:
     g.mlist rast=gpcp_1dd_p1d.*.*
 by having a separate option for each type.

 ...using separate options means...
 multiple remove/rename/copy operations in a single command. But I
 wouldn't expect that usage to be particularly common...
 }}}

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



More information about the grass-dev mailing list