[GRASS-dev] Re: doubt with single/double dashed flags from interface description

Markus Metz markus.metz.giswork at googlemail.com
Wed May 25 02:50:28 EDT 2011


Hi Andrea,

the double-dash options are generic options available for every module
and not defined by the module: --overwrite, --verbose, --quiet. These
options are used to set global environment variables. Using
r.watershed as example, it could be called through python with e.g.

grass.run_command("r.watershed", elevation = input, accumulation =
output, flags = 'a', overwrite = True, verbose = True)

Some modules, e.g. some of the import modules, have their own
(single-dash) -o flag, where

v.in.ogr -o --o

means "override projection check and overwrite output if existing"

IOW, you could ignore these three double-dash options when handling
flags of interface descriptions because they are available for every
module and not module-specific, if that makes your life easier in
generating wrappers.

HTH,

Markus M


On Tue, May 24, 2011 at 9:23 PM, andrea antonello
<andrea.antonello at gmail.com> wrote:
> My only guess here is that single character flags have a single dash
> and multiple character flags a double dash?
>
> Andrea
>
> On Tue, May 24, 2011 at 9:12 PM, andrea antonello
> <andrea.antonello at gmail.com> wrote:
>> Hi all,
>> I have a problem with the handling of flags in the interface description.
>>
>> Let's take for example pieces of r.watershed,
>> The help tells me:
>> [...]
>>  -a   Use positive flow accumulation even for likely underestimates
>>        See manual for a detailed description of flow accumulation output
>>  --o   Allow output files to overwrite existing files
>> [...]
>>
>> and the interface description:
>> [...]
>>
>>        <flag name="a">
>>                <label>
>>                        Use positive flow accumulation even for likely underestimates
>>                </label>
>>                <description>
>>                        See manual for a detailed description of flow accumulation output
>>                </description>
>>        </flag>
>>        <flag name="overwrite">
>>                <description>
>>                        Allow output files to overwrite existing files
>>                </description>
>>        </flag>
>> [...]
>>
>> I can't find a way to understand why the first has one single dash,
>> while the overwrite flag needs two.
>> Any hints?
>>
>> Thanks,
>> Andrea
>>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>


More information about the grass-dev mailing list