mirror of
https://github.com/borgbackup/borg.git
synced 2026-03-26 20:34:45 -04:00
cli: expand repo::archive parse errors with corrected command lines
When --repo uses legacy repo::archive syntax, show list and repo-info style examples.
This commit is contained in:
parent
6bc41465a4
commit
d6d0cd6de3
1 changed files with 13 additions and 0 deletions
|
|
@ -616,6 +616,19 @@ class Location:
|
|||
|
||||
self.raw = text # as given by user, might contain placeholders
|
||||
self.processed = replace_placeholders(self.raw, overrides) # after placeholder replacement
|
||||
if "::" in self.processed:
|
||||
repo, archive = self.processed.split("::", 1)
|
||||
raise ValueError(
|
||||
f'Invalid location format: "{self.processed}". '
|
||||
"Borg 2 does not accept repo::archive syntax. "
|
||||
"Corrected command lines:\n"
|
||||
f"borg -r {repo} list {archive}\n"
|
||||
f"export BORG_REPO={repo}\n"
|
||||
f"borg list {archive}\n"
|
||||
f"borg -r {repo} repo-info\n"
|
||||
f"export BORG_REPO={repo}\n"
|
||||
f"borg repo-info"
|
||||
)
|
||||
valid = self._parse(self.processed)
|
||||
if valid:
|
||||
self.valid = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue