Skip to content

Commit

Permalink
fix must_exist setting
Browse files Browse the repository at this point in the history
allow --newer and --older to be specified as a date
support borg's various ways of checking the archives and repositories
allow archive indices to be negative
raise an error if --dry-run accompanies a command that does not support it
fix --before and --after
improve the description of the commands support the archive selection options
fix the list command to allow it to take a path argument
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Jan 5, 2025
1 parent 54e2100 commit d7b0895
Show file tree
Hide file tree
Showing 4 changed files with 540 additions and 155 deletions.
8 changes: 4 additions & 4 deletions assimilate/assimilate.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def initialize(self, name, settings):
if not name:
raise Error(
"you must specify a config.",
codicil=f"Choose from: {conjoin(known_configs, ', or ')}"
codicil=f"Choose from: {conjoin(sorted(known_configs), ', or ')}."
)

# check that name is known
if name not in known_configs:
raise Error(
'unknown config.',
codicil=f"Choose from: {conjoin(known_configs, ', or ')}.",
codicil=f"Choose from: {conjoin(sorted(known_configs), ', or ')}.",
culprit=name
)

Expand All @@ -162,7 +162,7 @@ def initialize(self, name, settings):
if unknown_configs:
raise Error(
f"unknown {plural(unknown_configs):config/s}:",
f"{', '.join(unknown_configs)}.",
f"{', '.join(sorted(unknown_configs))}.",
culprit=(name, "composite_configs")
)
if name in sub_configs:
Expand Down Expand Up @@ -566,7 +566,7 @@ def as_paths(self, name, resolve=True, must_exist=False):
"""Convert setting to paths, without resolution."""
return [
self.to_path(s, resolve, name if must_exist else None)
for s in self.values(name)
for s in self.settings.get(name, ())
]

# borg_options() {{{2
Expand Down
Loading

0 comments on commit d7b0895

Please sign in to comment.