Skip to content

Commit

Permalink
repo-list --short: only print archive IDs
Browse files Browse the repository at this point in the history
Needed to change this because listing just the
archive names is pretty useless if names are not
unique.

The short list is likely mostly used by scripts to
iterate over all archives, so outputting IDs is
better.
  • Loading branch information
ThomasWaldmann committed Sep 26, 2024
1 parent 8461538 commit 1b68053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/borg/archiver/repo_list_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def do_repo_list(self, args, repository, manifest):
if args.format is not None:
format = args.format
elif args.short:
format = "{archive}{NL}"
format = "{id}{NL}"
else:
format = os.environ.get("BORG_RLIST_FORMAT", "{archive:<36} {time} [{id}]{NL}")
formatter = ArchiveFormatter(format, repository, manifest, manifest.key, iec=args.iec)
Expand Down Expand Up @@ -93,7 +93,7 @@ def build_parser_repo_list(self, subparsers, common_parser, mid_common_parser):
)
subparser.set_defaults(func=self.do_repo_list)
subparser.add_argument(
"--short", dest="short", action="store_true", help="only print the archive names, nothing else"
"--short", dest="short", action="store_true", help="only print the archive IDs, nothing else"
)
subparser.add_argument(
"--format",
Expand Down

0 comments on commit 1b68053

Please sign in to comment.