[GRASS-dev] g.mremove: adding 'map name exclusion pattern' option

Markus Neteler neteler at osgeo.org
Fri May 2 07:47:33 PDT 2014


On Fri, May 2, 2014 at 3:01 AM, Huidae Cho <grass4u at gmail.com> wrote:
> Well, the g.mremove interface looks convenient, but can be dangerous also.
> For example, yesterday, I almost deleted my raster files by using the
> positional parameter thing while trying to delete all my temporary vectors.
>
> g.mremove tmp*
>
> Whops! 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.

The easiest workaround is that we reorder the parameter list. At time we have
rast = 1st = default.

See
http://grass.osgeo.org/grass71/manuals/g.mremove.html

Putting there, say, "label" will enforce the user to have to set rast=
for deleting raster maps. This would require no extra efforts and
minimize the risk except for those using labels (so we could even add
a dummy parameter there. Or select another rather unknown parameter
from that list to become the first in the list).

Markus


More information about the grass-dev mailing list