1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-04 18:48:43 +00:00

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.
This commit is contained in:
Thomas Waldmann 2022-11-04 23:29:58 +01:00
parent 01b921dea4
commit d57ed9dd98

View file

@ -3614,7 +3614,7 @@ class Archiver:
subparser.add_argument('location', metavar='ARCHIVE', subparser.add_argument('location', metavar='ARCHIVE',
type=location_validator(archive=True), type=location_validator(archive=True),
help='name of archive to create (must be also a valid directory name)') 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') help='paths to archive')
# borg debug # borg debug