[GRASS-dev] [GRASS GIS] #2579: Specify command to be exectued as parameter of grass command
GRASS GIS
trac at osgeo.org
Fri May 15 14:34:09 PDT 2015
#2579: Specify command to be exectued as parameter of grass command
--------------------------+----------------------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: normal | Milestone: 7.1.0
Component: Startup | Version: svn-trunk
Resolution: | Keywords: batch job, GRASS_BATCH_JOB, init
CPU: Unspecified | Platform: All
--------------------------+----------------------------------------------
Comment (by wenzeslaus):
First version of executing command specified as parameter implemented in
r65252. Please try:
{{{
grass71 ~/grassdata/nc_spm_08_grass7/user1/ exec g.region -p
}}}
If you are interested more, something like:
{{{
grass71 -c EPGS:4545 ~/grassdata/nc_spm_08_grass7/user1/ exec g.region -p
}}}
should work too. See commit message for details (there is no doc yet).
Alternative syntax would be:
{{{
grass71 exec ~/grassdata/nc_spm_08_grass7/user1/ g.region -p
grass71 exec -c EPSG:4545 ~/grassdata/nc_spm_08_grass7/user1/ g.region -p
}}}
which supposes that both mapset path and command are mandatory and appear
together (and `exec` is always the first one, mapset path is last from
standard parameters). This is quite nice in relation to the other
potential extension discussed in the this ticket.
However, the option I used seems to me a little bit better when considered
alone. Perhaps I should change `exec` to `--exec` (I believe we should not
use `-exec`) and leave the "subcommand syntax" to their actual
implementation. I used `exec` rather than `batch` (or even `batch-job`)
because the word //batch// is used in far too many different meanings.
It required some refactoring in r65238, r65241, r65246, r65247, r65248,
r65250, r65251 and although I split it into small portions and tested what
I could, the code is quite tricky and critical, so it would be to get it
tested throughly (I would like to see some automated tests too but I had
no idea how to do it).
`GRASS_BATCH_JOB` is still supported and should be supported at least in
the 7.x series (can be removed for 8 if not useful).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2579#comment:11>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list