aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools/main.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2017-04-27 15:27:51 +1200
committerAldo Cortesi <aldo@nullcube.com>2017-04-27 15:27:51 +1200
commit8c4810f6069bcf592d480e5cc2d7338cd176085e (patch)
treef3e76c6b5af13e57e84cce28c2acc35a9018aad4 /mitmproxy/tools/main.py
parentee3dd3f3c5b6fe42df547156f25ab6e6f6578fff (diff)
downloadmitmproxy-8c4810f6069bcf592d480e5cc2d7338cd176085e.tar.gz
mitmproxy-8c4810f6069bcf592d480e5cc2d7338cd176085e.tar.bz2
mitmproxy-8c4810f6069bcf592d480e5cc2d7338cd176085e.zip
console: flow resolution command
This is our first built-in command, which will be used by very many other commands. Also add a --commands option to dump all commands, analogous to --options.
Diffstat (limited to 'mitmproxy/tools/main.py')
-rw-r--r--mitmproxy/tools/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mitmproxy/tools/main.py b/mitmproxy/tools/main.py
index b83a35d1..9621dbbc 100644
--- a/mitmproxy/tools/main.py
+++ b/mitmproxy/tools/main.py
@@ -39,7 +39,7 @@ def process_options(parser, opts, args):
if args.version:
print(debug.dump_system_info())
sys.exit(0)
- if args.quiet or args.options:
+ if args.quiet or args.options or args.commands:
args.verbosity = 0
args.flow_detail = 0
@@ -84,6 +84,13 @@ def run(MasterKlass, args, extra=None): # pragma: no cover
if args.options:
print(optmanager.dump_defaults(opts))
sys.exit(0)
+ if args.commands:
+ cmds = []
+ for c in master.commands.commands.values():
+ cmds.append(c.signature_help())
+ for i in sorted(cmds):
+ print(i)
+ sys.exit(0)
opts.set(*args.setoptions)
if extra:
opts.update(**extra(args))