mitmproxy/examples/simple/custom_option.py
Aldo Cortesi b745428b5c Enable custom options in config files
We also now ignore unknown options in config files by default, and print a
warning if verbosity is incremented.
2017-03-14 09:40:33 +13:00

12 lines
289 B
Python

from mitmproxy import ctx
def start(options):
ctx.log.info("Registering option 'custom'")
options.add_option("custom", bool, False, "A custom option")
def configure(options, updated):
if "custom" in updated:
ctx.log.info("custom option value: %s" % options.custom)