Jelajahi Sumber

repo-list --short: only print archive IDs

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.
Thomas Waldmann 8 bulan lalu
induk
melakukan
1b680531ee
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/borg/archiver/repo_list_cmd.py

+ 2 - 2
src/borg/archiver/repo_list_cmd.py

@@ -20,7 +20,7 @@ class RepoListMixIn:
         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)
@@ -93,7 +93,7 @@ class RepoListMixIn:
         )
         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",