[GRASS5] perl module for grass scripting

Glynn Clements glynn at gclements.plus.com
Wed Mar 16 06:56:43 EST 2005


Jachym Cepicky wrote:

> I use Perl for writing simple scripts for GRASS. Now I desided to write my own
> perl-module (grass.pm), which should simplify the code writing. It generates
> the help message and loads all required commandline options.
> 
> According to GRASS-Bash scripts, it would be good, if GRASS could generate the
> Tk-GUI `on the fly' for the Perl (Python, ...) scripts too.
> 
> But how to do it? What procedure should one call and how?
> 
> I'm sending the module below and I'm hoping, it could be usefull.
> 
> Thank you for hints

To process command-line options, you should use the g.parser program. 
Whilst it was originally intended for use in shell scripts, it should
be usable from any language which uses the '#' character for comments.

Regarding the GUI dialogs: you can run the program with the --ui flag. 
This will cause the program to generate and display the dialog, then
re-execute itself with the chosen options.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list