mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 12:45:34 +00:00
delete: more Highlander options, fixes #6269
This commit is contained in:
parent
1aae04e66e
commit
13e99033cb
2 changed files with 15 additions and 7 deletions
|
@ -372,6 +372,7 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True, ol
|
|||
dest="sort_by",
|
||||
type=SortBySpec,
|
||||
default=sort_by_default,
|
||||
action=Highlander,
|
||||
help="Comma-separated list of sorting keys; valid keys are: {}; default is: {}".format(
|
||||
", ".join(AI_HUMAN_SORT_KEYS), sort_by_default
|
||||
),
|
||||
|
@ -383,16 +384,18 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True, ol
|
|||
"--first",
|
||||
metavar="N",
|
||||
dest="first",
|
||||
default=0,
|
||||
type=positive_int_validator,
|
||||
default=0,
|
||||
action=Highlander,
|
||||
help="consider first N archives after other filters were applied",
|
||||
)
|
||||
group.add_argument(
|
||||
"--last",
|
||||
metavar="N",
|
||||
dest="last",
|
||||
default=0,
|
||||
type=positive_int_validator,
|
||||
default=0,
|
||||
action=Highlander,
|
||||
help="consider last N archives after other filters were applied",
|
||||
)
|
||||
|
||||
|
@ -401,15 +404,17 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True, ol
|
|||
group.add_argument(
|
||||
"--oldest",
|
||||
metavar="TIMESPAN",
|
||||
type=relative_time_marker_validator,
|
||||
dest="oldest",
|
||||
type=relative_time_marker_validator,
|
||||
action=Highlander,
|
||||
help="consider archives between the oldest archive's timestamp and (oldest + TIMESPAN), e.g. 7d or 12m.",
|
||||
)
|
||||
group.add_argument(
|
||||
"--newest",
|
||||
metavar="TIMESPAN",
|
||||
type=relative_time_marker_validator,
|
||||
dest="newest",
|
||||
type=relative_time_marker_validator,
|
||||
action=Highlander,
|
||||
help="consider archives between the newest archive's timestamp and (newest - TIMESPAN), e.g. 7d or 12m.",
|
||||
)
|
||||
|
||||
|
@ -418,15 +423,17 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True, ol
|
|||
group.add_argument(
|
||||
"--older",
|
||||
metavar="TIMESPAN",
|
||||
type=relative_time_marker_validator,
|
||||
dest="older",
|
||||
type=relative_time_marker_validator,
|
||||
action=Highlander,
|
||||
help="consider archives older than (now - TIMESPAN), e.g. 7d oder 12m.",
|
||||
)
|
||||
group.add_argument(
|
||||
"--newer",
|
||||
metavar="TIMESPAN",
|
||||
type=relative_time_marker_validator,
|
||||
dest="newer",
|
||||
type=relative_time_marker_validator,
|
||||
action=Highlander,
|
||||
help="consider archives newer than (now - TIMESPAN), e.g. 7d or 12m.",
|
||||
)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import argparse
|
||||
import logging
|
||||
|
||||
from ._common import with_repository
|
||||
from ._common import with_repository, Highlander
|
||||
from ..archive import Archive, Statistics
|
||||
from ..cache import Cache
|
||||
from ..constants import * # NOQA
|
||||
|
@ -156,6 +156,7 @@ def build_parser_delete(self, subparsers, common_parser, mid_common_parser):
|
|||
dest="checkpoint_interval",
|
||||
type=int,
|
||||
default=1800,
|
||||
action=Highlander,
|
||||
help="write checkpoint every SECONDS seconds (Default: 1800)",
|
||||
)
|
||||
define_archive_filters_group(subparser)
|
||||
|
|
Loading…
Reference in a new issue