[GRASS-dev] [GRASS GIS] #1259: g.remove deletes raster maps by default: could delete the wrong map

#1259: g.remove deletes raster maps by default: could delete the wrong map
----------------------------------------+-----------------------------------
Reporter: benducke | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.remove, raster, deletion | Platform: Unspecified
      Cpu: Unspecified |
----------------------------------------+-----------------------------------
If I run g.remove with only the name of a non-existing
map, I get this:

   g.remove tmp
   Removing raster <tmp>
   WARNING: Raster map <tmp> not found
   WARNING: <tmp> nothing removed

This indicates that g.remove tries to remove a raster of
name "tmp" by default. I am not sure this is good behaviour.
What if the user meant a vector map and forgot to explicitely
type "vect=tmp". In such a case, the wrong map might get
deleted, instead of just an error message being issued.

Also, the synopsis for g.remove does not indicate that there
is a default removal type.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259&gt;
GRASS GIS <http://grass.osgeo.org>

#1259: g.remove deletes raster maps by default: could delete the wrong map
----------------------------------------+-----------------------------------
Reporter: benducke | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.remove, raster, deletion | Platform: Unspecified
      Cpu: Unspecified |
----------------------------------------+-----------------------------------
Changes (by martinl):

  * type: defect => enhancement

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1259: g.remove deletes raster maps by default: could delete the wrong map
----------------------------------------+-----------------------------------
Reporter: benducke | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.remove, raster, deletion | Platform: Unspecified
      Cpu: Unspecified |
----------------------------------------+-----------------------------------

Comment(by martinl):

From ML

{{{
It's "default" behaviour. If the first argument doesn't contain an "="
character, it's assumed to be the value of the first registered
option.

This behaviour applies to all modules. Currently, there isn't any way
for individual commands to disable it without resorting to "hacks",
e.g. making the first option a dummy option (which would then show up
in the help output and manual page).

Glynn
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1259: g.remove deletes raster maps by default: could delete the wrong map
----------------------------------------+-----------------------------------
Reporter: benducke | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.remove, raster, deletion | Platform: Unspecified
      Cpu: Unspecified |
----------------------------------------+-----------------------------------

Comment(by wenzeslaus):

See and comment on #2414 (Replace g.list/g.remove with g.mlist/g.mremove)
which might solve this issue. This has to be solved before 7.0 because it
requires interface change.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1259: g.remove deletes raster maps by default: could delete the wrong map
----------------------------------------+-----------------------------------
Reporter: benducke | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.remove, raster, deletion | Platform: Unspecified
      Cpu: Unspecified |
----------------------------------------+-----------------------------------

Comment(by hcho):

See #2414. Now the interface of g.remove has changed to require a type
explicitly.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1259: g.remove deletes raster maps by default: could delete the wrong map
--------------------------+-------------------------------------------------
  Reporter: benducke | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: fixed | Keywords: g.remove, raster, deletion
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

Closing since the backport of the new interface of g.remove has been
backported to relbranch7.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1259#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>