소스 검색

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",