Explorar o código

fix changes requested about stats

Felix Buehler %!s(int64=6) %!d(string=hai) anos
pai
achega
7516443a89
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 1 2
      borgmatic/borg/create.py
  2. 4 2
      borgmatic/commands/borgmatic.py

+ 1 - 2
borgmatic/borg/create.py

@@ -136,11 +136,10 @@ def create_archive(
         + (('--lock-wait', str(lock_wait)) if lock_wait else ())
         + (('--lock-wait', str(lock_wait)) if lock_wait else ())
         + (('--list', '--filter', 'AME-') if logger.isEnabledFor(logging.INFO) else ())
         + (('--list', '--filter', 'AME-') if logger.isEnabledFor(logging.INFO) else ())
         + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
         + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
-        + (('--stats',) if not dry_run and logger.isEnabledFor(logging.INFO) else ())
+        + (('--stats',) if not dry_run and (logger.isEnabledFor(logging.INFO) or stats) else ())
         + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
         + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
         + (('--dry-run',) if dry_run else ())
         + (('--dry-run',) if dry_run else ())
         + (('--progress',) if progress else ())
         + (('--progress',) if progress else ())
-        + (('--stats',) if stats else ())
         + (('--json',) if json else ())
         + (('--json',) if json else ())
     )
     )
 
 

+ 4 - 2
borgmatic/commands/borgmatic.py

@@ -112,7 +112,7 @@ def parse_arguments(*arguments):
         dest='stats',
         dest='stats',
         default=False,
         default=False,
         action='store_true',
         action='store_true',
-        help='Display status with --create or --prune option for each file as it is backed up',
+        help='Display statistics of archive with --create or --prune option',
     )
     )
     parser.add_argument(
     parser.add_argument(
         '--json',
         '--json',
@@ -160,7 +160,9 @@ def parse_arguments(*arguments):
         raise ValueError('The --progress option can only be used with the --create option')
         raise ValueError('The --progress option can only be used with the --create option')
 
 
     if args.stats and not (args.create or args.prune):
     if args.stats and not (args.create or args.prune):
-        raise ValueError('The --stats option can only be used with the --create, or --prune options')
+        raise ValueError(
+            'The --stats option can only be used with the --create, or --prune options'
+        )
 
 
     if args.json and not (args.create or args.list or args.info):
     if args.json and not (args.create or args.list or args.info):
         raise ValueError(
         raise ValueError(