[GRASS-dev] Re: [GRASS-SVN] r49204 - grass/trunk/vector/v.info

shrug, `-g` is mainly used for shell script output, I think it would
be better update `r.info` and `v.info` to follow this logic, g.region
is an exception. You are going to the opposite direction!

2011/11/14 <svn_grass@osgeo.org>:

Author: hamish
Date: 2011-11-13 22:49:25 -0800 (Sun, 13 Nov 2011)
New Revision: 49204

Modified:
grass/trunk/vector/v.info/parse.c
grass/trunk/vector/v.info/v.info.html
Log:
swap (ie restore) flags: -g is used throughout for map region info, same usage as g.region and r.info

Modified: grass/trunk/vector/v.info/parse.c

--- grass/trunk/vector/v.info/parse.c 2011-11-13 23:58:35 UTC (rev 49203)
+++ grass/trunk/vector/v.info/parse.c 2011-11-14 06:49:25 UTC (rev 49204)
@@ -30,19 +30,19 @@
_("Print types/names of table columns for specified layer instead of info and exit");
col_flag->guisection = _("Print");

+ region_flag = G_define_flag();
+ region_flag->key = 'g';
+ region_flag->description = _("Print region info in shell script style");
+ region_flag->guisection = _("Print");
+
shell_flag = G_define_flag();
- shell_flag->key = 'g';
- shell_flag->description = _("Print basic info in shell script style");
+ shell_flag->key = 'e';
+ shell_flag->description = _("Print extended metadata info in shell script style");
shell_flag->guisection = _("Print");

- region_flag = G_define_flag();
- region_flag->key = 'e';
- region_flag->description = _("Print also region info in shell script style");
- region_flag->guisection = _("Print");
-
topo_flag = G_define_flag();
topo_flag->key = 't';
- topo_flag->description = _("Print also topology info in shell script style");
+ topo_flag->description = _("Print topology info in shell script style");
topo_flag->guisection = _("Print");

if \(G\_parser\(argc, argv\)\)

Modified: grass/trunk/vector/v.info/v.info.html

--- grass/trunk/vector/v.info/v.info.html 2011-11-13 23:58:35 UTC (rev 49203)
+++ grass/trunk/vector/v.info/v.info.html 2011-11-14 06:49:25 UTC (rev 49204)
@@ -116,7 +116,7 @@
</pre></div>

<div class="code"><pre>
-v.info -e map=geology
+v.info -g map=geology

north=318117.43741634
south=10875.82723209

_______________________________________________
grass-commit mailing list
grass-commit@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-commit

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

Martin wrote:

shrug, `-g` is mainly used for shell script output,
I think it would be better update `r.info` and `v.info` to
follow this logic, g.region is an exception. You are going to
the opposite direction!

AFAIR g.region was the original, using -g to display region
bounds in shell script style. later "-g" was added to r.info
and v.info to do the same, and later again "-g" was added to
other modules like r.univar as generic shell script style
alias -- not the other way around! These were mostly added by
MarkusN and myself over the years, although I am very sure
there were others involved too.

r.info -g, v.info -g, g.region -g all show the region in shell
script style and all act the same. it's a good thing and makes
learning the tools easier. IMO it would be a disservice to morph
-g into a shell style dump of all internal variables. it clutters
your working environment.

2c from fuzzy memories of years ago,
Hamish

Hi,
sometimes it is a good idea to rethink existing design decisions and
re-implement it in a better way. As you stated the shell style output
was added to the modules successively without having a specific design
rule, but imitating g.region. Maybe its a good time to change this, at
least in GRASS 7.

As an example the Vask lib and therefor interactive behavior of
modules was removed too, to implement it in a better, more modular way
... .

IMHO the point is that GRASS 7 is designed to use Python as scripting
language. So the working environment wont mess up, if a dictionary is
used to manage the modules output.

Best regards
Soeren

2011/11/14 Hamish <hamish_b@yahoo.com>:

Martin wrote:

shrug, `-g` is mainly used for shell script output,
I think it would be better update `r.info` and `v.info` to
follow this logic, g.region is an exception. You are going to
the opposite direction!

AFAIR g.region was the original, using -g to display region
bounds in shell script style. later "-g" was added to r.info
and v.info to do the same, and later again "-g" was added to
other modules like r.univar as generic shell script style
alias -- not the other way around! These were mostly added by
MarkusN and myself over the years, although I am very sure
there were others involved too.

r.info -g, v.info -g, g.region -g all show the region in shell
script style and all act the same. it's a good thing and makes
learning the tools easier. IMO it would be a disservice to morph
-g into a shell style dump of all internal variables. it clutters
your working environment.

2c from fuzzy memories of years ago,
Hamish
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hamish wrote:

Martin wrote:

shrug, `-g` is mainly used for shell script output,
I think it would be better update `r.info` and `v.info` to
follow this logic, g.region is an exception. You are going to
the opposite direction!

AFAIR g.region was the original, using -g to display region
bounds in shell script style. later "-g" was added to r.info
and v.info to do the same, and later again "-g" was added to
other modules like r.univar as generic shell script style
alias -- not the other way around! These were mostly added by
MarkusN and myself over the years, although I am very sure
there were others involved too.

Quickly glancing at grass 4.0, g.region -p prints the current region,
whereas the -g flag is there to print in shell style. What exactly is
printed in shell style is obviously module-dependent (emphasis on
shell-style, not content).

my 2c

Markus M

r.info -g, v.info -g, g.region -g all show the region in shell
script style and all act the same. it's a good thing and makes
learning the tools easier. IMO it would be a disservice to morph
-g into a shell style dump of all internal variables. it clutters
your working environment.

2c from fuzzy memories of years ago,
Hamish
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Mon, Nov 14, 2011 at 11:51 AM, Markus Metz
<markus.metz.giswork@googlemail.com> wrote:

Quickly glancing at grass 4.0, g.region -p prints the current region,
whereas the -g flag is there to print in shell style. What exactly is
printed in shell style is obviously module-dependent (emphasis on
shell-style, not content).

Exactly what I had in mind - shell style was the idea. Also to avoid
to have to parse a zillion other flags.

Markus