[GRASS-dev] specifying overwrite flag in script

Is there some special way to specify an overwrite flag in a script? Or is it just:

#%flag
#% key: o
#% description: Overwrite existing files
#%end

Michael


C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

Hi,

2012/6/26 Michael Barton <Michael.Barton@asu.edu>:

Is there some special way to specify an overwrite flag in a script? Or is it
just:

overwrite flag should be added automatically by the parser when the
module produces any output. In really special cases you can force
adding overwrite flag by

#%module
...
#% overwrite: yes
#%end

Martin

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

I need to test for whether it is set or not in a script.

I found the answer

grass.overwrite()

Michael

On Jun 26, 2012, at 2:02 PM, Martin Landa wrote:

2012/6/26 Michael Barton <Michael.Barton@asu.edu>:

What is the test for the parser based overwrite flag?

as I told you the flag is added by parser automatically when there is
at least one option which is dedicated for output, eg. G_OPT_V_OUTPUT
or G_OPT_F_OUTPUT.

Martin

--
Martin Landa <landa.martin gmail.com> * Studijní program Geodézie a kartografie – GeoWikiCZ

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu