Skip to content

Commit 6b0badc

Browse files
preprocess_args: fix option name matching
previously, it also matched on --sort-by when it only should have matched on --sort.
1 parent d0dabe6 commit 6b0badc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/borg/archiver/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def preprocess_args(self, args):
180180
]
181181
for i, arg in enumerate(args[:]):
182182
for old_name, new_name, warning in deprecations:
183-
if arg.startswith(old_name):
183+
# either --old_name or --old_name=...
184+
if arg == old_name or (arg.startswith(old_name) and arg[len(old_name)] == "="):
184185
if new_name is not None:
185186
args[i] = arg.replace(old_name, new_name)
186187
print(warning, file=sys.stderr)

0 commit comments

Comments
 (0)