diff options
author | Aldo Cortesi <aldo@corte.si> | 2017-03-19 14:01:32 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2017-03-19 14:01:32 +1300 |
commit | 1b6bc874b5b3f7d352e9b181c774ea044957a6e6 (patch) | |
tree | af7542edeb1ea7d3d65ade0e19410587d579da3e | |
parent | 43e7b9d68c4dc0c67c43175af52a00c5601496e0 (diff) | |
download | mitmproxy-1b6bc874b5b3f7d352e9b181c774ea044957a6e6.tar.gz mitmproxy-1b6bc874b5b3f7d352e9b181c774ea044957a6e6.tar.bz2 mitmproxy-1b6bc874b5b3f7d352e9b181c774ea044957a6e6.zip |
console options: "d" to reset this option to default
-rw-r--r-- | mitmproxy/tools/console/options.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mitmproxy/tools/console/options.py b/mitmproxy/tools/console/options.py index 65b903db..20f53f81 100644 --- a/mitmproxy/tools/console/options.py +++ b/mitmproxy/tools/console/options.py @@ -30,6 +30,7 @@ def _mkhelp(): keys = [ ("enter", "edit option"), ("D", "reset all to defaults"), + ("d", "reset this option to default"), ("w", "save options"), ] text.extend(common.format_keyvals(keys, key="key", val="text", indent=4)) @@ -193,7 +194,14 @@ class OptionsList(urwid.ListBox): elif key == "esc": self.walker.stop_editing() else: - if key == "g": + if key == "d": + foc, idx = self.get_focus() + setattr( + self.master.options, + foc.opt.name, + self.master.options.default(foc.opt.name) + ) + elif key == "g": self.set_focus(0) self.walker._modified() elif key == "G": |