浏览代码

Add "list" option to configuration, corresponding to "--list" (#303).

Dan Helfman 3 月之前
父节点
当前提交
ed6022d4a9
共有 5 个文件被更改,包括 26 次插入14 次删除
  1. 1 1
      borgmatic/actions/create.py
  2. 1 1
      borgmatic/actions/export_tar.py
  3. 1 1
      borgmatic/borg/delete.py
  4. 1 1
      borgmatic/borg/prune.py
  5. 22 10
      borgmatic/config/schema.yaml

+ 1 - 1
borgmatic/actions/create.py

@@ -330,7 +330,7 @@ def run_create(
             progress=create_arguments.progress or config.get('progress'),
             stats=create_arguments.stats or config.get('stats'),
             json=create_arguments.json,
-            list_files=create_arguments.list_files,
+            list_files=create_arguments.list_files or config.get('list'),
             stream_processes=stream_processes,
         )
 

+ 1 - 1
borgmatic/actions/export_tar.py

@@ -43,6 +43,6 @@ def run_export_tar(
             local_path=local_path,
             remote_path=remote_path,
             tar_filter=export_tar_arguments.tar_filter,
-            list_files=export_tar_arguments.list_files,
+            list_files=export_tar_arguments.list_files or config.get('list'),
             strip_components=export_tar_arguments.strip_components,
         )

+ 1 - 1
borgmatic/borg/delete.py

@@ -34,7 +34,7 @@ def make_delete_command(
         + borgmatic.borg.flags.make_flags('umask', config.get('umask'))
         + borgmatic.borg.flags.make_flags('log-json', global_arguments.log_json)
         + borgmatic.borg.flags.make_flags('lock-wait', config.get('lock_wait'))
-        + borgmatic.borg.flags.make_flags('list', delete_arguments.list_archives)
+        + borgmatic.borg.flags.make_flags('list', delete_arguments.list_archives or config.get('list'))
         + (
             (('--force',) + (('--force',) if delete_arguments.force >= 2 else ()))
             if delete_arguments.force

+ 1 - 1
borgmatic/borg/prune.py

@@ -88,7 +88,7 @@ def prune_archives(
             prune_arguments,
             excludes=('repository', 'match_archives', 'stats', 'list_archives'),
         )
-        + (('--list',) if prune_arguments.list_archives else ())
+        + (('--list',) if prune_arguments.list_archives or config.get('list') else ())
         + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
         + (('--dry-run',) if dry_run else ())
         + (tuple(extra_borg_options.split(' ')) if extra_borg_options else ())

+ 22 - 10
borgmatic/config/schema.yaml

@@ -49,30 +49,33 @@ properties:
                     type: string
                     description: |
                         The encryption mode with which to create the repository,
-                        only used for the repo-create action. To see the
-                        available encryption modes, run "borg init --help" with
-                        Borg 1 or "borg repo-create --help" with Borg 2.
+                        only used for the repo-create action. Also set via the
+                        "--encryption" flag. To see the available encryption
+                        modes, run "borg init --help" with Borg 1 or "borg
+                        repo-create --help" with Borg 2.
                     example: repokey-blake2
                 append_only:
                     type: boolean
                     description: |
                         Whether the repository should be created append-only,
-                        only used for the repo-create action. Defaults to false.
+                        only used for the repo-create action. Also set via the
+                        "--append-only" flag. Defaults to false.
                     default: false
                     example: true
                 storage_quota:
                     type: string
                     description: |
                         The storage quota with which to create the repository,
-                        only used for the repo-create action. Defaults to no
-                        quota.
+                        only used for the repo-create action. Also set via the
+                        "--storage-quota" flag. Defaults to no quota.
                     example: 5G
                 make_parent_dirs:
                     type: boolean
                     description: |
                         Whether any missing parent directories of the repository
                         path should be created, only used for the repo-create
-                        action. Defaults to false.
+                        action. Also set via the "--make-parent-dirs" flag.
+                        Defaults to false.
                     default: false
                     example: true
         description: |
@@ -812,15 +815,24 @@ properties:
     progress:
         type: boolean
         description: |
-            Display progress as each file or archive is processed. Defaults to
+            Display progress as each file or archive is processed when running
+            supported actions. Also set via the "--progress" flag. Defaults to
             false.
         default: false
         example: true
     stats:
         type: boolean
         description: |
-            Display statistics of an archive when running supported actions.
-            Defaults to false.
+            Display statistics for an archive when running supported actions.
+            Also set via the "--stats" flag. Defaults to false.
+        default: false
+        example: true
+    list:
+        type: boolean
+        description: |
+            Display details for each file or archive as it is processed when
+            running supported actions. Also set via the "--list" flag. Defaults
+            to false.
         default: false
         example: true
     skip_actions: