We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Use CommandParser for configmodel.bind
In the `new-config` branch, there's a `CommandParser` in `commands/runners.py` which got split off from `CommandRunner` and can be used standalone. Various places doing their own command parsing got updated accordingly, but `configmodel.bind` is still doing its own parsing. An example how it's used, from `:bind`:

https://github.com/qutebrowser/qutebrowser/blob/2117824cf9fdc47ea6fd9457c12cecbac117202e/qutebrowser/config/config.py#L179-L189

Split off from #2779, cc @rcorre - if you want to take a look at this, feel free to do a PR against `new-config`, or wait until that's merged and then do one against `master`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `qutebrowser/completion/models/configmodel.py`
Content:
```
1 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
2 
3 # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
4 #
5 # This file is part of qutebrowser.
6 #
7 # qutebrowser is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # qutebrowser is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with qutebrowser.  If not, see <http://www.gnu.org/licenses/>.
19 
20 """Functions that return config-related completion models."""
21 
22 from qutebrowser.config import configdata, configexc
23 from qutebrowser.completion.models import completionmodel, listcategory, util
24 from qutebrowser.commands import cmdutils
25 
26 
27 def option(*, info):
28     """A CompletionModel filled with settings and their descriptions."""
29     model = completionmodel.CompletionModel(column_widths=(20, 70, 10))
30     options = ((opt.name, opt.description, info.config.get_str(opt.name))
31                for opt in configdata.DATA.values())
32     model.add_category(listcategory.ListCategory("Options", sorted(options)))
33     return model
34 
35 
36 def value(optname, *_values, info):
37     """A CompletionModel filled with setting values.
38 
39     Args:
40         optname: The name of the config option this model shows.
41         _values: The values already provided on the command line.
42         info: A CompletionInfo instance.
43     """
44     model = completionmodel.CompletionModel(column_widths=(30, 70, 0))
45 
46     try:
47         current = info.config.get_str(optname) or '""'
48     except configexc.NoOptionError:
49         return None
50 
51     opt = info.config.get_opt(optname)
52     default = opt.typ.to_str(opt.default)
53     cur_cat = listcategory.ListCategory("Current/Default",
54         [(current, "Current value"), (default, "Default value")])
55     model.add_category(cur_cat)
56 
57     vals = opt.typ.complete()
58     if vals is not None:
59         model.add_category(listcategory.ListCategory("Completions",
60                                                      sorted(vals)))
61     return model
62 
63 
64 def bind(key, *, info):
65     """A CompletionModel filled with all bindable commands and descriptions.
66 
67     Args:
68         key: the key being bound.
69     """
70     model = completionmodel.CompletionModel(column_widths=(20, 60, 20))
71     cmd_text = info.keyconf.get_command(key, 'normal')
72 
73     if cmd_text:
74         cmd_name = cmd_text.split(' ')[0]
75         cmd = cmdutils.cmd_dict.get(cmd_name)
76         data = [(cmd_text, cmd.desc, key)]
77         model.add_category(listcategory.ListCategory("Current", data))
78 
79     cmdlist = util.get_cmd_completions(info, include_hidden=True,
80                                        include_aliases=True)
81     model.add_category(listcategory.ListCategory("Commands", cmdlist))
82     return model
83
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py
--- a/qutebrowser/completion/models/configmodel.py
+++ b/qutebrowser/completion/models/configmodel.py
@@ -21,7 +21,7 @@
 
 from qutebrowser.config import configdata, configexc
 from qutebrowser.completion.models import completionmodel, listcategory, util
-from qutebrowser.commands import cmdutils
+from qutebrowser.commands import runners
 
 
 def option(*, info):
@@ -71,8 +71,8 @@
     cmd_text = info.keyconf.get_command(key, 'normal')
 
     if cmd_text:
-        cmd_name = cmd_text.split(' ')[0]
-        cmd = cmdutils.cmd_dict.get(cmd_name)
+        parser = runners.CommandParser()
+        cmd = parser.parse(cmd_text).cmd
         data = [(cmd_text, cmd.desc, key)]
         model.add_category(listcategory.ListCategory("Current", data))

{"golden_diff": "diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py\n--- a/qutebrowser/completion/models/configmodel.py\n+++ b/qutebrowser/completion/models/configmodel.py\n@@ -21,7 +21,7 @@\n \n from qutebrowser.config import configdata, configexc\n from qutebrowser.completion.models import completionmodel, listcategory, util\n-from qutebrowser.commands import cmdutils\n+from qutebrowser.commands import runners\n \n \n def option(*, info):\n@@ -71,8 +71,8 @@\n     cmd_text = info.keyconf.get_command(key, 'normal')\n \n     if cmd_text:\n-        cmd_name = cmd_text.split(' ')[0]\n-        cmd = cmdutils.cmd_dict.get(cmd_name)\n+        parser = runners.CommandParser()\n+        cmd = parser.parse(cmd_text).cmd\n         data = [(cmd_text, cmd.desc, key)]\n         model.add_category(listcategory.ListCategory(\"Current\", data))\n", "issue": "Use CommandParser for configmodel.bind\nIn the `new-config` branch, there's a `CommandParser` in `commands/runners.py` which got split off from `CommandRunner` and can be used standalone. Various places doing their own command parsing got updated accordingly, but `configmodel.bind` is still doing its own parsing. An example how it's used, from `:bind`:\r\n\r\nhttps://github.com/qutebrowser/qutebrowser/blob/2117824cf9fdc47ea6fd9457c12cecbac117202e/qutebrowser/config/config.py#L179-L189\r\n\r\nSplit off from #2779, cc @rcorre - if you want to take a look at this, feel free to do a PR against `new-config`, or wait until that's merged and then do one against `master`.\n", "before_files": [{"content": "# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# qutebrowser is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with qutebrowser.  If not, see <http://www.gnu.org/licenses/>.\n\n\"\"\"Functions that return config-related completion models.\"\"\"\n\nfrom qutebrowser.config import configdata, configexc\nfrom qutebrowser.completion.models import completionmodel, listcategory, util\nfrom qutebrowser.commands import cmdutils\n\n\ndef option(*, info):\n    \"\"\"A CompletionModel filled with settings and their descriptions.\"\"\"\n    model = completionmodel.CompletionModel(column_widths=(20, 70, 10))\n    options = ((opt.name, opt.description, info.config.get_str(opt.name))\n               for opt in configdata.DATA.values())\n    model.add_category(listcategory.ListCategory(\"Options\", sorted(options)))\n    return model\n\n\ndef value(optname, *_values, info):\n    \"\"\"A CompletionModel filled with setting values.\n\n    Args:\n        optname: The name of the config option this model shows.\n        _values: The values already provided on the command line.\n        info: A CompletionInfo instance.\n    \"\"\"\n    model = completionmodel.CompletionModel(column_widths=(30, 70, 0))\n\n    try:\n        current = info.config.get_str(optname) or '\"\"'\n    except configexc.NoOptionError:\n        return None\n\n    opt = info.config.get_opt(optname)\n    default = opt.typ.to_str(opt.default)\n    cur_cat = listcategory.ListCategory(\"Current/Default\",\n        [(current, \"Current value\"), (default, \"Default value\")])\n    model.add_category(cur_cat)\n\n    vals = opt.typ.complete()\n    if vals is not None:\n        model.add_category(listcategory.ListCategory(\"Completions\",\n                                                     sorted(vals)))\n    return model\n\n\ndef bind(key, *, info):\n    \"\"\"A CompletionModel filled with all bindable commands and descriptions.\n\n    Args:\n        key: the key being bound.\n    \"\"\"\n    model = completionmodel.CompletionModel(column_widths=(20, 60, 20))\n    cmd_text = info.keyconf.get_command(key, 'normal')\n\n    if cmd_text:\n        cmd_name = cmd_text.split(' ')[0]\n        cmd = cmdutils.cmd_dict.get(cmd_name)\n        data = [(cmd_text, cmd.desc, key)]\n        model.add_category(listcategory.ListCategory(\"Current\", data))\n\n    cmdlist = util.get_cmd_completions(info, include_hidden=True,\n                                       include_aliases=True)\n    model.add_category(listcategory.ListCategory(\"Commands\", cmdlist))\n    return model\n", "path": "qutebrowser/completion/models/configmodel.py"}], "after_files": [{"content": "# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:\n\n# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>\n#\n# This file is part of qutebrowser.\n#\n# qutebrowser is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# qutebrowser is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with qutebrowser.  If not, see <http://www.gnu.org/licenses/>.\n\n\"\"\"Functions that return config-related completion models.\"\"\"\n\nfrom qutebrowser.config import configdata, configexc\nfrom qutebrowser.completion.models import completionmodel, listcategory, util\nfrom qutebrowser.commands import runners\n\n\ndef option(*, info):\n    \"\"\"A CompletionModel filled with settings and their descriptions.\"\"\"\n    model = completionmodel.CompletionModel(column_widths=(20, 70, 10))\n    options = ((opt.name, opt.description, info.config.get_str(opt.name))\n               for opt in configdata.DATA.values())\n    model.add_category(listcategory.ListCategory(\"Options\", sorted(options)))\n    return model\n\n\ndef value(optname, *_values, info):\n    \"\"\"A CompletionModel filled with setting values.\n\n    Args:\n        optname: The name of the config option this model shows.\n        _values: The values already provided on the command line.\n        info: A CompletionInfo instance.\n    \"\"\"\n    model = completionmodel.CompletionModel(column_widths=(30, 70, 0))\n\n    try:\n        current = info.config.get_str(optname) or '\"\"'\n    except configexc.NoOptionError:\n        return None\n\n    opt = info.config.get_opt(optname)\n    default = opt.typ.to_str(opt.default)\n    cur_cat = listcategory.ListCategory(\"Current/Default\",\n        [(current, \"Current value\"), (default, \"Default value\")])\n    model.add_category(cur_cat)\n\n    vals = opt.typ.complete()\n    if vals is not None:\n        model.add_category(listcategory.ListCategory(\"Completions\",\n                                                     sorted(vals)))\n    return model\n\n\ndef bind(key, *, info):\n    \"\"\"A CompletionModel filled with all bindable commands and descriptions.\n\n    Args:\n        key: the key being bound.\n    \"\"\"\n    model = completionmodel.CompletionModel(column_widths=(20, 60, 20))\n    cmd_text = info.keyconf.get_command(key, 'normal')\n\n    if cmd_text:\n        parser = runners.CommandParser()\n        cmd = parser.parse(cmd_text).cmd\n        data = [(cmd_text, cmd.desc, key)]\n        model.add_category(listcategory.ListCategory(\"Current\", data))\n\n    cmdlist = util.get_cmd_completions(info, include_hidden=True,\n                                       include_aliases=True)\n    model.add_category(listcategory.ListCategory(\"Commands\", cmdlist))\n    return model\n", "path": "qutebrowser/completion/models/configmodel.py"}]}