[GRASS5] d.legend and d.out.png

Michael Barton michael.barton at asu.edu
Sat Aug 21 21:53:37 EDT 2004

On 8/21/04 2:58 PM, "Glynn Clements" <glynn.clements at virgin.net> wrote:

> Michael Barton wrote:
>> Neither d.erase nor d.redraw are set up to run through g_parser(). AFAICT,
>> d.redraw doesn't have any options anyway.
> d.erase has one option, color=, but it only calls G_parser() if
> argc>1, so running it without any arguments will use the default
> setting rather than prompting the user for a value.
> A few other commands behave similarly. Specifically:
>     $ find src -name main.c | xargs fgrep G_parser | grep 'if \?(argc'
>     src/display/d.erase/main.c: if (argc > 1 && G_parser(argc, argv))
>     src/display/d.extend/cmd/main.c:    if(argc > 1 && G_parser(argc, argv))
>     src/display/d.measure/cmd/main.c: if (argc > 1 && G_parser(argc,argv))
>     src/display/d.pan/main.c:    if (argc > 1 && G_parser(argc,argv))

Any idea why d.pan doesn't work in GRASS 5.7 anymore? As per my recent
discussion with Hamish, it would be nice to get this functioning again.

>     src/display/d.where/cmd/main.c:    if (argc > 1 && G_parser(argc,argv))
>     src/display/d.info/main.c: if (argc > 1 && G_parser(argc, argv))
>     src/general/g.version/main.c:    if (argc > 1 && G_parser(argc, argv))
>     src/paint/Programs/p.chart/main.c:    if (argc > 1 && G_parser(argc,
> argv))
> Personally, I think that the user should only be prompted if no
> arguments are given but the program can't be run that way, i.e. if it
> has at least one non-optional argument.

Then how do you get a dialog when you want it? For example, how do you get a
gui dialog for d.erase if you want to select colors interactively (e.g., if
you want to see what is available for a background color)?

I'm not sure whether we are saying the same thing or the opposite. But to be
consistent across GRASS 5.7, it seems that all commands like this should go
through g_parser() and generate the normal tcltk dialog if they are run
without arguments. If they are run with arguments, they should work without
the dialog. In this case, it would also be good (as you or Hamish suggested)
to have a -default or -nogui flag to run them in default mode without the
dialog (e.g., d.erase -d [for default mode] would simply erase the screen to


> -- 
> Glynn Clements <glynn.clements at virgin.net>

C. Michael Barton, Professor
School of Human Diversity and Social Change
PO Box 872402
Arizona State University
Tempe, AZ  85287-2402

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

More information about the grass-dev mailing list