[GRASS-SVN] r32776 - grass/trunk/general/g.gui
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 15 08:59:10 EDT 2008
Author: martinl
Date: 2008-08-15 08:59:10 -0400 (Fri, 15 Aug 2008)
New Revision: 32776
Modified:
grass/trunk/general/g.gui/main.c
Log:
g.gui: don't initialize type->answer before calling G_parser()
Modified: grass/trunk/general/g.gui/main.c
===================================================================
--- grass/trunk/general/g.gui/main.c 2008-08-15 12:53:11 UTC (rev 32775)
+++ grass/trunk/general/g.gui/main.c 2008-08-15 12:59:10 UTC (rev 32776)
@@ -41,18 +41,12 @@
type->key = "gui";
type->type = TYPE_STRING;
type->required = YES;
- type->description = _("GUI type");
+ type->label = _("GUI type");
+ type->description = _("Default value: GRASS_GUI if defined otherwise wxpython");
type->descriptions = _("tcltk;Tcl/Tk based GUI - GIS Manager (gis.m);"
"oldtcltk;Old Tcl/Tk based GUI - Display Manager (d.m);"
"wxpython;wxPython based next generation GUI");
type->options = "tcltk,oldtcltk,wxpython";
- gui_type_env = G__getenv("GRASS_GUI");
- if (gui_type_env && strcmp(gui_type_env, "text")) {
- type->answer = G_store(gui_type_env);
- }
- else {
- type->answer = "tcltk";
- }
rc_file = G_define_standard_option(G_OPT_F_INPUT);
rc_file->key = "workspace";
@@ -66,6 +60,15 @@
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
+ if (!type->answer) {
+ gui_type_env = G__getenv("GRASS_GUI");
+ if (gui_type_env && strcmp(gui_type_env, "text")) {
+ type->answer = G_store(gui_type_env);
+ }
+ else {
+ type->answer = "wxpython";
+ }
+ }
if (((gui_type_env && oneoff->answer) &&
strcmp(gui_type_env, type->answer) != 0) || !gui_type_env) {
More information about the grass-commit
mailing list