[GRASS-dev] requring explicit input=-

re. r48434 (and a number of other places)

it's a PITA to have to type input=- all the time from the command
line in places where it can be readily inferred.

if the change is intended to make sure the option turns up on
the required tab(?), please see ticket #886 "improve module wxGUI
tab logic" for discussion on a proposed solution which does not
make the CLI experience more annoying.
  http://trac.osgeo.org/grass/ticket/886

thanks,
Hamish

Martin wrote:

* `input=-` means that it will read data from standard input,
so the command waits for that (it will wait for eternity if you
do not provide any input;-)

I don't have a solution to that (probably common) problem, but
fwiw I suspect less often people will try "-" in the gui by mis-
understanding what stdin means, so the problem does not go away
completely.

shrug,
Hamish

2011/9/24 Hamish <hamish_b@yahoo.com>:

Martin wrote:

* `input=-` means that it will read data from standard input,
so the command waits for that (it will wait for eternity if you
do not provide any input;-)

I don't have a solution to that (probably common) problem, but
fwiw I suspect less often people will try "-" in the gui by mis-
understanding what stdin means, so the problem does not go away
completely.

try r48444 (trunk). When providing <opt>=- GUI doesn't allow you to
run the command.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

2011/9/24 Hamish <hamish_b@yahoo.com>:

re. r48434 (and a number of other places)

it's a PITA to have to type input=- all the time from the command
line in places where it can be readily inferred.

well, I don't think that it's a PITA, it's just a little bit more
typing, in this case `i=-` :wink: Personally I would incline to force
user to define that stdin should be read. It leads to the more
readable module interface and probably less confusing for CLI
newcomers. What's your opinion, GRASS power users?

if the change is intended to make sure the option turns up on
the required tab(?), please see ticket #886 "improve module wxGUI

v.edit: <input> option is required just for `tool=add` not for other
options. Moreover <input> makes sense only for `tool=create|add`.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Martin wrote:

>> * `input=-` means that it will read data from standard input,
>> so the command waits for that (it will wait for eternity if
>> you do not provide any input;-)

Hamish:

> I don't have a solution to that (probably common) problem,

Martin:

try r48444 (trunk). When providing <opt>=- GUI doesn't allow
you to run the command.

thanks; does that now solve all outstanding issues with stdin vs.
the module guis? (when complaining earlier I had read the svn
log + emails out of order, and forgotten about the hung waiting-
for-input gui problem before posting; sorry for the noise)

can anyone think of a case where "-" would ever be used as an
arbitrary string, not meaning stdin?
I guess it is a similar probability to someone wanting to use a
literal "-" as a file or map name. g.message is all I can think
of, but that's not used in the gui menu.

Hamish

2011/9/24 Hamish <hamish_b@yahoo.com>:

can anyone think of a case where "-" would ever be used as an
arbit'rary string, not meaning stdin?
I guess it is a similar probability to someone wanting to use a
literal "-" as a file or map name. g.message is all I can think
of, but that's not used in the gui menu.

I don't know, anyway this rude check can be always replaced by full
check (gtask.parse_command/interface). wxGUI is quite over-complicated
(too much commands running on the background), let's try a simple
check first (without checking type of the options).

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hamish wrote:

can anyone think of a case where "-" would ever be used as an
arbitrary string, not meaning stdin?
I guess it is a similar probability to someone wanting to use a
literal "-" as a file or map name. g.message is all I can think
of, but that's not used in the gui menu.

"-" doesn't have to be special-cased for all options, only for options
with gisprompt == "old,file,input" (output=- isn't a problem). If an
old,file,input option has a default value of "-", the GUI should
discard the default.

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

Hi,

2011/9/24 Glynn Clements <glynn@gclements.plus.com>:

"-" doesn't have to be special-cased for all options, only for options
with gisprompt == "old,file,input" (output=- isn't a problem). If an
old,file,input option has a default value of "-", the GUI should
discard the default.

right, hopefully fixed in r48450.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa