[GRASS-dev] g.remove usage syntax

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?

Thank you

···

Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

Hi,

2015-05-05 12:28 GMT+02:00 Margherita Di Leo <diregola@gmail.com>:

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?

no idea, in any case it's issue for GRASS 8. Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

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

On Tue, May 5, 2015 at 3:30 AM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2015-05-05 12:28 GMT+02:00 Margherita Di Leo <diregola@gmail.com>:

> 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?

no idea, in any case it's issue for GRASS 8. Martin

Sure. Is there any place (track? wiki?) already where to collect and
discuss ideas? I saw recently in ML another post about r.shaded.relief, I
haven't followed up but perhaps also that discussion could be included.

Thanks

--
Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not
in any circumstance be regarded as stating an official position of the
European Commission.

2015-05-05 14:28 GMT+02:00 Margherita Di Leo <diregola@gmail.com>:

Sure. Is there any place (track? wiki?) already where to collect and discuss
ideas? I saw recently in ML another post about r.shaded.relief, I haven't
followed up but perhaps also that discussion could be included.

why not ticket with milestone 'GRASS 8'? Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

On Tue, May 5, 2015 at 2:46 PM, Martin Landa <landa.martin@gmail.com> wrote:

2015-05-05 14:28 GMT+02:00 Margherita Di Leo <diregola@gmail.com>:

Sure. Is there any place (track? wiki?) already where to collect and discuss
ideas? I saw recently in ML another post about r.shaded.relief, I haven't
followed up but perhaps also that discussion could be included.

why not ticket with milestone 'GRASS 8'? Martin

yes and additionally
http://trac.osgeo.org/grass/wiki/Grass8Planning

Markus

Hi Moritz,

···

On Tue, May 5, 2015 at 2:27 PM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

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.

hmm… I don’t understand why. I tried to tailor this proposal on the current behavior of the parser, as far as I could understand it. Can you explain a bit more?

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=$@
}

Thanks for the idea, I’ll try .

Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

On 05/05/15 15:41, Margherita Di Leo wrote:

Hi Moritz,

On Tue, May 5, 2015 at 2:27 PM, Moritz Lennert
<mlennert@club.worldonline.be <mailto:mlennert@club.worldonline.be>> wrote:

    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.

hmm.. I don't understand why. I tried to tailor this proposal on the
current behavior of the parser, as far as I could understand it. Can you
explain a bit more?

AFAIK, the parser only accepts the first argument as positional argument, for all the other arguments you have to provide the parameter name, so in your proposal

g.remove vect id=name searchstring=foo

would work, but

g.remove vect name foo

wouldn't.

As a side question: why do you find

g.remove type=vect id=pattern name="f*"

easier

than the current

g.remove type=vect pattern="f*"

?

The current behaviour does mean less typing (and just as much compared to your proposal with positional parameters, except for the '=').

Moritz