#1778: Typing in g.region without parameters does not open a g.region window
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
Cpu: x86-64 |
------------------------+---------------------------------------------------
Normally when you type a command, e.g., g.region, without parameters, a
new window for that command opens.
This does not seem to work for a few commands at the moment. Three ones
that seem to be affected are g.region, g.rename and g.copy.
Typing in these commands in the command console of the GRASS GIS layer
manager do open the windows
#1778: Typing in g.region without parameters does not open a g.region window
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
Cpu: x86-64 |
------------------------+---------------------------------------------------
Changes (by pvanbosgeo):
* cc: pvanbosgeo (added)
Comment:
Another example is r.colors, see:
GRASS 7.0.svn (CRU):~ > r.colors
ERROR: Options <map> or <file> must be specified
[Raster MASK present]
GRASS 7.0.svn (CRU):~ >
#1778: Typing in g.region without parameters does not open a g.region window
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
Cpu: x86-64 |
------------------------+---------------------------------------------------
Comment(by pvanbosgeo):
Sorry, that wasn't clear, let me try again:
{{{
GRASS 7.0.svn (CRU):~ > r.colors
ERROR: Options <map> or <file> must be specified
[Raster MASK present]
GRASS 7.0.svn (CRU):~ >
}}}
#1778: Typing in g.region without parameters does not open a g.region window
------------------------+---------------------------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
Cpu: x86-64 |
------------------------+---------------------------------------------------
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by mlennert):
All the examples given in this ticket are modules that have no required
parameters. As soon as at least one of the parameters is marked as
required, calling the module without parameters opens the GUI.
ISTR that there is an option to mark several parameters as "at least one
of these is required", but I can't find how to do this in the programmer's
manual.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [ticket:1778 pvanbosgeo]:
> Normally when you type a command, e.g., g.region, without parameters, a
new window for that command opens.
>
> This does not seem to work for a few commands at the moment. Three ones
that seem to be affected are g.region, g.rename and g.copy.
This is normal. If a command doesn't have any required options, executing
the command without parameters will not open a parameter dialog. You can
force a parameter dialog to be displayed using the --ui switch.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [comment:5 mlennert]:
> ISTR that there is an option to mark several parameters as "at least one
of these is required", but I can't find how to do this in the programmer's
manual.
No such feature exists at present, although it has been discussed on
occasion.
The only thing that has changed between 6.x and 7.0 in this regard is that
in 7.0, flags have a ->suppress_required field. If set, the parser won't
complain about "required" options not being provided if the flag is used.
This is useful for flags which perform a "show current status" function
for modules which normally have required options.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by martinl):
Replying to [comment:6 glynn]:
> Replying to [ticket:1778 pvanbosgeo]:
> > Normally when you type a command, e.g., g.region, without parameters,
a new window for that command opens.
> >
> > This does not seem to work for a few commands at the moment. Three
ones that seem to be affected are g.region, g.rename and g.copy.
>
> This is normal. If a command doesn't have any required options,
executing the command without parameters will not open a parameter dialog.
You can force a parameter dialog to be displayed using the --ui switch.
I would call it rather "current behaviour". It's probably confusing to the
user. Is there any reason why the dialog is not open in this case?
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by neteler):
Replying to [comment:8 martinl]:
> Replying to [comment:6 glynn]:
> > This is normal. If a command doesn't have any required options,
executing the command without parameters will not open a parameter dialog.
You can force a parameter dialog to be displayed using the --ui switch.
>
> I would call it rather "current behaviour". It's probably confusing to
the user. Is there any reason why the dialog is not open in this case?
For example, from d.erase (on CMD line) you expect that the screen be
erased, not that
you have to do extra GUI clicking. Or do you refer to g.region?
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by martinl):
Replying to [comment:9 neteler]:
> Replying to [comment:8 martinl]:
> > Replying to [comment:6 glynn]:
> > > This is normal. If a command doesn't have any required options,
executing the command without parameters will not open a parameter dialog.
You can force a parameter dialog to be displayed using the --ui switch.
> >
> > I would call it rather "current behaviour". It's probably confusing to
the user. Is there any reason why the dialog is not open in this case?
>
> For example, from d.erase (on CMD line) you expect that the screen be
erased, not that
> you have to do extra GUI clicking. Or do you refer to g.region?
yes, I am referring to `g.region`. There are probably more modules without
required parameters which have no expected effect as eg. `d.erase`.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [comment:8 martinl]:
> I would call it rather "current behaviour". It's probably confusing to
the user. Is there any reason why the dialog is not open in this case?
If it's valid (so far as the parser can determine) to run a module without
providing any options, then it will just get on with it, and not stop to
ask for additional options.
The real problem here is that there's no way to tell the parser that
"some" options are required when no particular option is required.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by cmbarton):
Remind me again why the parser was changed so that a module does not open
a GUI window when it is called from the command line and there are no
required parameters.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [comment:12 cmbarton]:
> Remind me again why the parser was changed so that a module does not
open a GUI window when it is called from the command line and there are no
required parameters.
Because it's a nuisance having e.g. "d.erase" pop up a parameter dialog
(or getting an error message about $DISPLAY not being set). It's also a
nuisance having to type "d.erase bgcolor=none" when that's the default.
The --ui flag exists if you specifically want a parameter dialog to be
displayed.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by annakrat):
So we need options to have another field (something like 'group_required')
which tells the parser that the certain options belong to a group of
options where one of them has to be specified by the user. Would it be
complicated to implement?
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by cmbarton):
Or something...
The problem you describe is indeed annoying. But it does not seem like a
good idea to have modules behave inconsistently and unpredictably from the
user perspective in order to solve it. The --ui flag should be default
behavior and not need the flag. Consistent behavior was one of the goals
of getting rid of persistent processes in modules.
The actual problem, and to my mind implementing a solution, seems to lie
in the modules that should run without a dialog rather than altering the
default behavior of launching a dialog when a module is run without
parameters. A logically better fix is to require the --ui flag only on
modules whose normal behavior is to run without arguments. g.region is not
such a module; d.erase is such a module. Perhaps there are even more
elegant fixes.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [comment:15 cmbarton]:
> The problem you describe is indeed annoying. But it does not seem like
a good idea to have modules behave inconsistently and unpredictably from
the user perspective in order to solve it.
The modules don't behave inconsistently. If you specify all of the
required parameters, the module just does what it's told without further
prompting.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by glynn):
Replying to [comment:14 annakrat]:
> So we need options to have another field (something like
'group_required') which tells the parser that the certain options belong
to a group of options where one of them has to be specified by the user.
Would it be complicated to implement?
The main complication is that someone will need to modify a very large
number of modules to have them declare their requirements. If we're going
to all that trouble, it would be better to finish the job.
As well as the case where at least one of a group of options must be
supplied, it's also common for certain options to be mutually exclusive,
or for certain options to require other options. In all cases, there may
be multiple such relationships.
If the information on the relationships between options was supplied to
the parser, not only could the parser perform such checks automatically,
but it would be able to supply the information to the GUI. So the GUI
could display this information to the user, e.g. by adding radio buttons
to options which belong to an "exactly one of" group, and/or greying out
options which have been excluded by the use of other options.
To have the parser perform checking, it would be enough to specify the
requirements as a boolean expression which must evaluate to true. But
that's hard for the GUI to translate into visual cues, and it's also hard
to produce useful error messages if the requirements aren't met.
So we really need a more restrictive form, but still something which is
flexible enough to handle the majority of the inter-dependencies between
options. As to exactly what that form should be, we really need some input
from the GUI developers.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Comment(by hamish):
Replying to [comment:17 glynn]:
> So the GUI could display this information to the user, e.g. by adding
> radio buttons to options which belong to an "exactly one of" group,
> and/or greying out options which have been excluded by the use of other
> options.
Hi,
fwiw, where modules have grown to contain many such flags often the basic
answer is to replace the flags with a single option=string with a drop
down menu containing the mutually exclusive possibilities. Radio buttons
shouldn't be needed when we have `opt->options = "";` and
`opt->descriptions = "";`.
that doesn't cover "multi-mode" modules, but for my 2c I'd consider those
by definition to be arbitrarily complicated special cases and leave the
error checking to the programmer not the parser.
#1778: Typing in g.region without parameters does not open a g.region window
----------------------------------------+-----------------------------------
Reporter: pvanbosgeo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: g.region, r.colors, r.mask | Platform: Linux
Cpu: x86-64 |
----------------------------------------+-----------------------------------
Changes (by mlennert):
* priority: critical => normal
Comment:
I think these discussions are important to improve usability, but I don't
think this bug warrants a "critical" priority. In fact, it is probably not
even a bug, but an enhancement request, as the modules in question do work
as expected. Downgrading to normal.