瀏覽代碼

wxGUI: catch and handle error from typo in console (merge from trunk, https://trac.osgeo.org/grass/changeset/65975)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@66354 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 年之前
父節點
當前提交
3353a64194
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      gui/wxpython/gui_core/forms.py

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

@@ -2360,6 +2360,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: