aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/tools/_main.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/mitmproxy/tools/_main.py b/mitmproxy/tools/_main.py
index 8a98278d..bcec7327 100644
--- a/mitmproxy/tools/_main.py
+++ b/mitmproxy/tools/_main.py
@@ -17,8 +17,6 @@ from mitmproxy import optmanager
from mitmproxy import proxy
from mitmproxy.utils import debug, arg_check
-OPTIONS_FILE_NAME = "config.yaml"
-
def assert_utf8_env():
spec = ""
@@ -69,6 +67,8 @@ def run(
options.
"""
debug.register_info_dumpers()
+ # Be tolerant as the yml is often recommended
+ OPTIONS_FILE_NAMES = ["config.yaml", "config.yml"]
opts = options.Options()
master = master_cls(opts)
@@ -87,10 +87,11 @@ def run(
sys.exit(1)
try:
opts.set(*args.setoptions, defer=True)
- optmanager.load_paths(
- opts,
- os.path.join(opts.confdir, OPTIONS_FILE_NAME),
- )
+ for conf_file in OPTIONS_FILE_NAMES:
+ optmanager.load_paths(
+ opts,
+ os.path.join(opts.confdir, conf_file),
+ )
pconf = process_options(parser, opts, args)
server: typing.Any = None
if pconf.options.server: