Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1409 closed defect (fixed)

wxGUI command console does not parse correctly "help" and first parameter

Reported by: philippbs Owned by: martinl
Priority: normal Milestone: 6.4.2
Component: wxGUI Version: svn-releasebranch64
Keywords: cmd, d. Cc: grass-dev@…
CPU: x86-64 Platform: All

Description

The wxGUI command line console does not parse commands correctly, critically the 'help' option does not work. e.g.

d.vect help

results in

ERROR: Rendering failed

and erases the map display and it leads to the undesired creation of a layer 'help' in the Map Layers tab.

Similarly, implicit parameter declarations are not parsed, e.g. (using the North Carolina dataset)

d.vect streams  

results in the same error message as above and the creation of a layer 'streams' in Map Layers.

Change History (9)

comment:1 by neteler, 13 years ago

Platform: MSWindows 7All

Confirmed on Linux.

In GRASS 7, on Linux the usage of "d.vect help" in the cmd console leads instead to:

Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/prompt.py", line 1097, in
OnKeyPressed

self.parent.RunCmd(cmd)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/goutput.py", line 506, in
RunCmd

layerType = layertype)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/gui_modules/utils.py", line 144, in
GetLayerNameFromCmd

dcmd[i] = p + '=' + v
TypeError
:
unsupported operand type(s) for +: 'NoneType' and 'str'

comment:2 by cmbarton, 13 years ago

The command console is not designed to support the in-terminal help. Instead, pressing the <tab> key will show the command syntax, much like typing help. There needs to be a better error trap when "help" is typed to inform the user of that.

There is also a full help manual as a tab in every command module.

comment:3 by cmbarton, 13 years ago

I stand corrected. If you type the command, followed by "help", the standard terminal help will print to the console output window.

This works for all commands EXCEPT d.* commands. When I type a d.* command, followed by "help", I get an error "Error: rendering failed" and all subsequent attempts to display a map in the window fail (with the same error). It acts like I've switched to the Cairo driver, but the display says it is still on the PNG driver.

Some weird bug here.

comment:4 by cmbarton, 13 years ago

Figure it out. Overly simple. Needs a better error trap

Typing "d.rast help" in the command console adds a blank map layer named "help" to the list of layers, obscuring all layers below. It also generates the "rendering failed" error because it cannot render the non-existant map "help".

in reply to:  description comment:5 by martinl, 13 years ago

Cc: grass-dev@… added
Keywords: cmd d. added
Owner: changed from grass-dev@… to martinl
Status: newassigned

Replying to philippbs:

The wxGUI command line console does not parse commands correctly, critically the 'help' option does not work. e.g.

> d.vect help

try out r47251 (backported in r47252 to devbr6 for testing).

d.vect help

should print out usage of the module.

d.vect stream

should add stream map (from search path) to layer tree. After some testing it could be backported to relbr64.

comment:6 by neteler, 13 years ago

I have tested r47252 (6.5), works now. I have also tested -help and --help, works, too. Thanks!

comment:7 by cmbarton, 13 years ago

I just tested this too, and it works.

Thanks.

comment:8 by cmbarton, 13 years ago

Resolution: fixed
Status: assignedclosed

comment:9 by martinl, 13 years ago

Backported to relbr64 in r47256. Now ticket can be closed.

Note: See TracTickets for help on using tickets.