aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/types.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2017-12-19 11:50:12 +1300
committerAldo Cortesi <aldo@corte.si>2017-12-19 11:50:12 +1300
commitd98fc4f03a88751944c0ae08ee2ac3e743f92952 (patch)
tree3978a872336a35c89e754e017f430d1269e234de /mitmproxy/types.py
parent843bad187cfe40c9714c6deb5170d055021a462e (diff)
downloadmitmproxy-d98fc4f03a88751944c0ae08ee2ac3e743f92952.tar.gz
mitmproxy-d98fc4f03a88751944c0ae08ee2ac3e743f92952.tar.bz2
mitmproxy-d98fc4f03a88751944c0ae08ee2ac3e743f92952.zip
commands: partial parser now returns help for remaining arguments
Diffstat (limited to 'mitmproxy/types.py')
-rw-r--r--mitmproxy/types.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mitmproxy/types.py b/mitmproxy/types.py
index 35d4ed7e..36f33943 100644
--- a/mitmproxy/types.py
+++ b/mitmproxy/types.py
@@ -174,6 +174,8 @@ class _CmdType(_BaseType):
return list(manager.commands.keys())
def parse(self, manager: _CommandBase, t: type, s: str) -> str:
+ if s not in manager.commands:
+ raise exceptions.TypeError("Unknown command: %s" % s)
return s
def is_valid(self, manager: _CommandBase, typ: typing.Any, val: typing.Any) -> bool: