[GRASS-dev] g.mapsets: adding switch for shell style listing

Is there any reason _not_ to have shell style listing (line-by-line) of
Mapsets?

So far,

- "g.mapset -l" prints available mapsets, inside the current LOCATION, the one
after the other

- "g.mapsets -l" alphabetically lists all available Mapsets grouped in three
columns
- "g.mapsets -p" prints the mapsets in current search path, again, grouped in
three columns

I can't get them through a pipe to grep-em! Wouldn't it be useful, for one-
liners to have, for example, something like "g.mapsets -l -g" or
"g.mapsets -p -g" that would list all/queried Mapsets in a line-by-line
manner.

Thanks, Nikos

Hi,

2013/1/17 Nikos Alexandris <nik@nikosalexandris.net>:

Is there any reason _not_ to have shell style listing (line-by-line) of
Mapsets?

in G7 try

g.mapsets -l --q sep=newline

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Nikos:

> Is there any reason _not_ to have shell style listing (line-by-line) of
> Mapsets?

Martin:

in G7 try

g.mapsets -l --q sep=newline

There is also fs= in G6!! Blind me... :-?

Thanks Martin, N

2013/1/17 Nikos Alexandris <nik@nikosalexandris.net>:

There is also fs= in G6!! Blind me... :-?

right, `fs` has been renamed to `separator` in G7.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi Nikos,

On Thu, Jan 17, 2013 at 1:07 PM, Martin Landa <landa.martin@gmail.com> wrote:

2013/1/17 Nikos Alexandris <nik@nikosalexandris.net>:

Is there any reason _not_ to have shell style listing (line-by-line) of
Mapsets?

in G7 try

g.mapsets -l --q sep=newline

or if you are using python in grass7, with:

from pygrass.gis import Location
loc = Location()
loc.mapsets()

['user1', 'PERMANENT']

Why the parameter mapset is it set as a required (that i not true... )?

@main.c line:69
    opt.mapset = G_define_option();
    opt.mapset->key = "mapset";
    opt.mapset->type = TYPE_STRING;
    opt.mapset->required = YES;
    opt.mapset->multiple = YES;
    opt.mapset->description = _("Name(s) of existing mapset(s)");
    opt.mapset->guisection = _("Search path");

Pietro