diff --git a/src/debugpy/server/cli.py b/src/debugpy/server/cli.py index a035cbb5..87846650 100644 --- a/src/debugpy/server/cli.py +++ b/src/debugpy/server/cli.py @@ -190,7 +190,9 @@ def parse_argv(): except StopIteration: raise ValueError("missing target: " + TARGET) - switch = arg if arg.startswith("-") else "" + switch = compat.filename(arg) + if not switch.startswith("-"): + switch = "" for pattern, placeholder, action in switches: if re.match("^(" + pattern + ")$", switch): break