|
@@ -321,6 +321,7 @@ int G_parser(int argc, char **argv)
|
|
|
{
|
|
|
int need_first_opt;
|
|
|
int opt_checked = 0;
|
|
|
+ const char *gui_envvar;
|
|
|
char *ptr, *tmp_name, *err;
|
|
|
int i;
|
|
|
struct Option *opt;
|
|
@@ -433,9 +434,10 @@ int G_parser(int argc, char **argv)
|
|
|
}
|
|
|
|
|
|
/* If there are NO arguments, go interactive */
|
|
|
-
|
|
|
+ gui_envvar = G_getenv_nofatal("GUI");
|
|
|
if (argc < 2 && (st->has_required || G__has_required_rule())
|
|
|
- && !st->no_interactive && isatty(0)) {
|
|
|
+ && !st->no_interactive && isatty(0) &&
|
|
|
+ G_strcasecmp(gui_envvar, "text") != 0) {
|
|
|
if (module_gui_wx() == 0)
|
|
|
return -1;
|
|
|
}
|