From d57ed9dd98e9e94e23fff24de1b8a84d45b0e35b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 4 Nov 2022 23:29:58 +0100 Subject: [PATCH] fix args.paths related argparsing, fixes #6994 argparse: the default action is "store" and that overwrote an already existing list in args.paths (e.g. from --pattern="R someroot") when it started to process the positional PATH args. with "extend" it now extends the existing args.paths with the list of positional PATH arguments (which can be 0..N elements long, nargs="*"). note: "extend" is new since python 3.8, thus this can only be backported to 1.2-maint, but not to 1.1-maint. --- src/borg/archiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 4a11e10c3..da8a6cb54 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -3614,7 +3614,7 @@ class Archiver: subparser.add_argument('location', metavar='ARCHIVE', type=location_validator(archive=True), help='name of archive to create (must be also a valid directory name)') - subparser.add_argument('paths', metavar='PATH', nargs='*', type=str, + subparser.add_argument('paths', metavar='PATH', nargs='*', type=str, action='extend', help='paths to archive') # borg debug