瀏覽代碼

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 月之前
父節點
當前提交
1b680531ee
共有 1 個文件被更改,包括 2 次插入2 次删除
  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",