Vandal 2 ماه پیش
والد
کامیت
a1d2f7f221
2فایلهای تغییر یافته به همراه11 افزوده شده و 0 حذف شده
  1. 4 0
      borgmatic/borg/recreate.py
  2. 7 0
      borgmatic/commands/arguments.py

+ 4 - 0
borgmatic/borg/recreate.py

@@ -30,11 +30,15 @@ def recreate_archive(
 
 
     repo_archive_arg = make_repository_archive_flags(repository, archive, local_borg_version)
     repo_archive_arg = make_repository_archive_flags(repository, archive, local_borg_version)
     exclude_flags = make_exclude_flags(config)
     exclude_flags = make_exclude_flags(config)
+    # handle path from recreate_arguments
+    path_flag = ('--path', recreate_arguments.path) if recreate_arguments.path else ()
+
 
 
     recreate_cmd = (
     recreate_cmd = (
         (local_path, 'recreate')
         (local_path, 'recreate')
         + (('--remote-path', remote_path) if remote_path else ())
         + (('--remote-path', remote_path) if remote_path else ())
         + repo_archive_arg
         + repo_archive_arg
+        + path_flag
         + (('--log-json',) if global_arguments.log_json else ())
         + (('--log-json',) if global_arguments.log_json else ())
         + (('--lock-wait', str(lock_wait)) if lock_wait else ())
         + (('--lock-wait', str(lock_wait)) if lock_wait else ())
         + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
         + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())

+ 7 - 0
borgmatic/commands/arguments.py

@@ -1562,6 +1562,13 @@ def make_parsers():
         '--archive',
         '--archive',
         help='Name of the archive to recreate',
         help='Name of the archive to recreate',
     )
     )
+    recreate_group.add_argument(
+        '--path',
+        metavar='PATH',
+        dest='paths',
+        action='append',
+        help='Path to recreate the repository/archive',
+    )
     recreate_group.add_argument(
     recreate_group.add_argument(
         '-h', '--help', action='help', help='Show this help message and exit'
         '-h', '--help', action='help', help='Show this help message and exit'
     )
     )