aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/command.py
diff options
context:
space:
mode:
authorItai Sadan <itaisod@gmail.com>2020-01-18 11:22:54 +0200
committerItai Sadan <itaisod@gmail.com>2020-01-18 11:22:54 +0200
commit046de4a39b40c7805136926abe349da760a9753f (patch)
treedb657a0fc114ec7f014f38f906cc19821a6c1a01 /mitmproxy/command.py
parent0afd0c933b7b5a3654cb6a9e27e8e24dbedcd789 (diff)
downloadmitmproxy-046de4a39b40c7805136926abe349da760a9753f.tar.gz
mitmproxy-046de4a39b40c7805136926abe349da760a9753f.tar.bz2
mitmproxy-046de4a39b40c7805136926abe349da760a9753f.zip
Expose CommandManager.call_strings and use it in consoleaddons.py
This avoids the whole quote/unquote issue.
Diffstat (limited to 'mitmproxy/command.py')
-rw-r--r--mitmproxy/command.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/command.py b/mitmproxy/command.py
index 341a1401..8822bb9b 100644
--- a/mitmproxy/command.py
+++ b/mitmproxy/command.py
@@ -241,7 +241,7 @@ class CommandManager:
raise exceptions.CommandError("Unknown command: %s" % command_name)
return self.commands[command_name].func(*args)
- def _call_strings(self, command_name: str, args: typing.Sequence[str]) -> typing.Any:
+ def call_strings(self, command_name: str, args: typing.Sequence[str]) -> typing.Any:
"""
Call a command using a list of string arguments. May raise CommandError.
"""
@@ -262,7 +262,7 @@ class CommandManager:
for part in parts
if part.type != mitmproxy.types.Space
]
- return self._call_strings(command_name, args)
+ return self.call_strings(command_name, args)
def dump(self, out=sys.stdout) -> None:
cmds = list(self.commands.values())