[GRASS-dev] new v.support metadata module

Markus Neteler neteler at itc.it
Thu Mar 15 11:50:32 EDT 2007


Hi,

I have added another parameter "cmdhist" to add strings (hist formatted) to the
command history in metadata (for 'v.info -h map').
This is useful for all vector *scripts* which so far do not extend
the vector history.

Example:

v.random rand n=20
v.db.addcol rand col="mycol integer"
v.info -h rand
COMMAND: v.random output="rand" n=20 zmin=0.0 zmax=0.0
GISDBASE: /home/neteler/grassdata
LOCATION: spearfish60 MAPSET: neteler USER: neteler DATE: Thu Mar 15 16:36:22 2007
# ... so far 'v.db.addcol' doesn't appear in the history file


# now:
v.support rand cmdhist="v.db.addcol rand col='mycol integer'"
v.info -h rand
COMMAND: v.random output="rand" n=20 zmin=0.0 zmax=0.0
GISDBASE: /home/neteler/grassdata
LOCATION: spearfish60 MAPSET: neteler USER: neteler DATE: Thu Mar 15 16:36:22 2007
---------------------------------------------------------------------------------
COMMAND: v.db.addcol rand col='mycol integer'
GISDBASE: /home/neteler/grassdata
LOCATION: spearfish60 MAPSET: neteler USER: neteler DATE: Thu Mar 15 16:44:01 2007


Question:
What's the best trick to construct the cmd line automatically in
g.parser supported scripts? Stuff like
 CMDLINE="$0 $@"
fails since g.parser modifies the shell parameters. The solution should then
go into all scripts/v*/v* where appropriate.

Markus




More information about the grass-dev mailing list