Bläddra i källkod

Merge pull request #4605 from ThomasWaldmann/use-borg-repo

Use BORG_REPO
TW 6 år sedan
förälder
incheckning
8a6463d7bc
1 ändrade filer med 16 tillägg och 16 borttagningar
  1. 16 16
      src/borg/archiver.py

+ 16 - 16
src/borg/archiver.py

@@ -2672,9 +2672,9 @@ class Archiver:
                                                  help='benchmarks borg CRUD (create, extract, update, delete).')
                                                  help='benchmarks borg CRUD (create, extract, update, delete).')
         subparser.set_defaults(func=self.do_benchmark_crud)
         subparser.set_defaults(func=self.do_benchmark_crud)
 
 
-        subparser.add_argument('location', metavar='REPO',
+        subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
-                               help='repo to use for benchmark (must exist)')
+                               help='repository to use for benchmark (must exist)')
 
 
         subparser.add_argument('path', metavar='PATH', help='path were to create benchmark input data')
         subparser.add_argument('path', metavar='PATH', help='path were to create benchmark input data')
 
 
@@ -2806,7 +2806,7 @@ class Archiver:
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           help='compact segment files / free space in repo')
                                           help='compact segment files / free space in repo')
         subparser.set_defaults(func=self.do_compact)
         subparser.set_defaults(func=self.do_compact)
-        subparser.add_argument('location', metavar='REPOSITORY',
+        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
                                help='repository to compact')
                                help='repository to compact')
         subparser.add_argument('--cleanup-commits', dest='cleanup_commits', action='store_true',
         subparser.add_argument('--cleanup-commits', dest='cleanup_commits', action='store_true',
@@ -2843,7 +2843,7 @@ class Archiver:
         group.add_argument('-l', '--list', dest='list', action='store_true',
         group.add_argument('-l', '--list', dest='list', action='store_true',
                                help='list the configuration of the repo')
                                help='list the configuration of the repo')
 
 
-        subparser.add_argument('location', metavar='REPOSITORY',
+        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
                                type=location_validator(archive=False, proto='file'),
                                type=location_validator(archive=False, proto='file'),
                                help='repository to configure')
                                help='repository to configure')
         subparser.add_argument('name', metavar='NAME', nargs='?',
         subparser.add_argument('name', metavar='NAME', nargs='?',
@@ -3138,7 +3138,7 @@ class Archiver:
         subparser.set_defaults(func=self.do_debug_dump_repo_objs)
         subparser.set_defaults(func=self.do_debug_dump_repo_objs)
         subparser.add_argument('location', metavar='REPOSITORY',
         subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
-                               help='repo to dump')
+                               help='repository to dump')
         subparser.add_argument('--ghost', dest='ghost', action='store_true',
         subparser.add_argument('--ghost', dest='ghost', action='store_true',
                                help='dump all segment file contents, including deleted/uncommitted objects and commits.')
                                help='dump all segment file contents, including deleted/uncommitted objects and commits.')
 
 
@@ -3153,7 +3153,7 @@ class Archiver:
         subparser.set_defaults(func=self.do_debug_search_repo_objs)
         subparser.set_defaults(func=self.do_debug_search_repo_objs)
         subparser.add_argument('location', metavar='REPOSITORY',
         subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
-                               help='repo to search')
+                               help='repository to search')
         subparser.add_argument('wanted', metavar='WANTED', type=str,
         subparser.add_argument('wanted', metavar='WANTED', type=str,
                                help='term to search the repo for, either 0x1234abcd hex term or a string')
                                help='term to search the repo for, either 0x1234abcd hex term or a string')
 
 
@@ -3166,7 +3166,7 @@ class Archiver:
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           help='get object from repository (debug)')
                                           help='get object from repository (debug)')
         subparser.set_defaults(func=self.do_debug_get_obj)
         subparser.set_defaults(func=self.do_debug_get_obj)
-        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
+        subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
                                help='repository to use')
                                help='repository to use')
         subparser.add_argument('id', metavar='ID', type=str,
         subparser.add_argument('id', metavar='ID', type=str,
@@ -3183,7 +3183,7 @@ class Archiver:
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           help='put object to repository (debug)')
                                           help='put object to repository (debug)')
         subparser.set_defaults(func=self.do_debug_put_obj)
         subparser.set_defaults(func=self.do_debug_put_obj)
-        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
+        subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
                                help='repository to use')
                                help='repository to use')
         subparser.add_argument('paths', metavar='PATH', nargs='+', type=str,
         subparser.add_argument('paths', metavar='PATH', nargs='+', type=str,
@@ -3198,7 +3198,7 @@ class Archiver:
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           help='delete object from repository (debug)')
                                           help='delete object from repository (debug)')
         subparser.set_defaults(func=self.do_debug_delete_obj)
         subparser.set_defaults(func=self.do_debug_delete_obj)
-        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
+        subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
                                help='repository to use')
                                help='repository to use')
         subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
         subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
@@ -3213,7 +3213,7 @@ class Archiver:
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           formatter_class=argparse.RawDescriptionHelpFormatter,
                                           help='show refcount for object from repository (debug)')
                                           help='show refcount for object from repository (debug)')
         subparser.set_defaults(func=self.do_debug_refcount_obj)
         subparser.set_defaults(func=self.do_debug_refcount_obj)
-        subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
+        subparser.add_argument('location', metavar='REPOSITORY',
                                type=location_validator(archive=False),
                                type=location_validator(archive=False),
                                help='repository to use')
                                help='repository to use')
         subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
         subparser.add_argument('ids', metavar='IDs', nargs='+', type=str,
@@ -3277,9 +3277,9 @@ class Archiver:
                                     'use ``--force --force`` in case ``--force`` does not work.')
                                     'use ``--force --force`` in case ``--force`` does not work.')
         subparser.add_argument('--save-space', dest='save_space', action='store_true',
         subparser.add_argument('--save-space', dest='save_space', action='store_true',
                                help='work slower, but using less space')
                                help='work slower, but using less space')
-        subparser.add_argument('location', metavar='TARGET', nargs='?', default='',
+        subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
                                type=location_validator(),
                                type=location_validator(),
-                               help='archive or repository to delete')
+                               help='repository or archive to delete')
         subparser.add_argument('archives', metavar='ARCHIVE', nargs='*',
         subparser.add_argument('archives', metavar='ARCHIVE', nargs='*',
                                help='archives to delete')
                                help='archives to delete')
         define_archive_filters_group(subparser)
         define_archive_filters_group(subparser)
@@ -3461,7 +3461,7 @@ class Archiver:
         subparser.set_defaults(func=self.do_info)
         subparser.set_defaults(func=self.do_info)
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
                                type=location_validator(),
                                type=location_validator(),
-                               help='archive or repository to display information about')
+                               help='repository or archive to display information about')
         subparser.add_argument('--json', action='store_true',
         subparser.add_argument('--json', action='store_true',
                                help='format output as JSON')
                                help='format output as JSON')
         define_archive_filters_group(subparser)
         define_archive_filters_group(subparser)
@@ -3750,7 +3750,7 @@ class Archiver:
                                     'A "bpath" key is therefore not available.')
                                     'A "bpath" key is therefore not available.')
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
                                type=location_validator(),
                                type=location_validator(),
-                               help='repository/archive to list contents of')
+                               help='repository or archive to list contents of')
         subparser.add_argument('paths', metavar='PATH', nargs='*', type=str,
         subparser.add_argument('paths', metavar='PATH', nargs='*', type=str,
                                help='paths to list; patterns are supported')
                                help='paths to list; patterns are supported')
         define_archive_filters_group(subparser)
         define_archive_filters_group(subparser)
@@ -3810,7 +3810,7 @@ class Archiver:
                                             help='mount repository')
                                             help='mount repository')
         subparser.set_defaults(func=self.do_mount)
         subparser.set_defaults(func=self.do_mount)
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', type=location_validator(),
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', type=location_validator(),
-                            help='repository/archive to mount')
+                            help='repository or archive to mount')
         subparser.add_argument('mountpoint', metavar='MOUNTPOINT', type=str,
         subparser.add_argument('mountpoint', metavar='MOUNTPOINT', type=str,
                             help='where to mount filesystem')
                             help='where to mount filesystem')
         subparser.add_argument('-f', '--foreground', dest='foreground',
         subparser.add_argument('-f', '--foreground', dest='foreground',
@@ -4017,7 +4017,7 @@ class Archiver:
 
 
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='',
                                type=location_validator(),
                                type=location_validator(),
-                               help='repository/archive to recreate')
+                               help='repository or archive to recreate')
         subparser.add_argument('paths', metavar='PATH', nargs='*', type=str,
         subparser.add_argument('paths', metavar='PATH', nargs='*', type=str,
                                help='paths to recreate; patterns are supported')
                                help='paths to recreate; patterns are supported')