aboutsummaryrefslogtreecommitdiffstats
path: root/examples/simple/custom_option.py
blob: 5b6070dd774948a0ff5efe7fa79d5ac20ae92e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
from mitmproxy import ctx


def load(l):
    ctx.log.info("Registering option 'custom'")
    l.add_option("custom", bool, False, "A custom option")


def configure(updated):
    if "custom" in updated:
        ctx.log.info("custom option value: %s" % ctx.options.custom)