浏览代码

wxGUI: catch and handle error from typo in console

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65975 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 年之前
父节点
当前提交
5f8224a405
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      gui/wxpython/gui_core/forms.py

+ 2 - 0
gui/wxpython/gui_core/forms.py

@@ -2440,6 +2440,8 @@ class GUI:
             cmd_validated = [cmd[0]]
             for option in cmd[1:]:
                 if option[0] == '-': # flag
+                    if len(option) == 1:  # catch typo like 'g.proj - w'
+                        raise gcmd.GException, _("Unable to parse command '%s'") % ' '.join(cmd)
                     if option[1] == '-':
                         self.grass_task.set_flag(option[2:], True)
                     else: