aboutsummaryrefslogtreecommitdiffstats
path: root/examples/simple/custom_option.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simple/custom_option.py')
-rw-r--r--examples/simple/custom_option.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/simple/custom_option.py b/examples/simple/custom_option.py
new file mode 100644
index 00000000..e9c34850
--- /dev/null
+++ b/examples/simple/custom_option.py
@@ -0,0 +1,10 @@
+from mitmproxy import ctx
+
+
+def start(options):
+ ctx.log.info("Registering option 'custom'")
+ options.add_option("custom", str, "default", "A custom option")
+
+
+def configure(options, updated):
+ ctx.log.info("custom option value: %s" % options.custom)