[GRASS-dev] g.remove usage syntax

Moritz Lennert mlennert at club.worldonline.be
Tue May 5 05:27:59 PDT 2015


On 05/05/15 12:28, Margherita Di Leo wrote:
> Dear All,
>
> I find the current syntax of g.remove a bit cumbersome, because it
> doesn't seem to me in line with what happens with other commands.
> If I want to remove the vector file foo, I have to type:
>
> g.remove vect name=foo -f
>
> Without the "name=" it won't work, which is not in line to the usage of
> other commands.
> To me it would be more natural (and indeed i always type wrong the first
> time) something like:
>
> g.remove vect name foo -f
>
> being name one of the two options (name, pat) that could be identifier=
> or something better. In this case, it would be possible to type the
> former command or the extended form:
>
> g.remove type=vect identifier=name name=foo -f
> or
> g.remove type=vect identifier=pattern name="f*" -f
> (g.remove vect pat "f*" -f)
>
> what do you think?

AFAIK, this would mean a fundamental change in the way the parser works.

I think it might be better to create small wrapper scripts, e.g.:

g.remove.vect

which could use just the name option of g.remove to have a syntax such 
as this:

g.remove.vect foo -f

If you use GNU/Linux you can also do this very simply by defining a 
function in .grass7/bashrc:

g.remove.vect ()
         {
                 g.remove type=vect name=$@
         }


Moritz



More information about the grass-dev mailing list