浏览代码

check for the stream --progress uses, not stdin

Antoine Beaupré 10 年之前
父节点
当前提交
1c0fb82b59
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      borg/archiver.py

+ 1 - 1
borg/archiver.py

@@ -677,7 +677,7 @@ Type "Yes I am sure" if you understand this and want to continue.\n""")
         subparser.add_argument('-s', '--stats', dest='stats',
         subparser.add_argument('-s', '--stats', dest='stats',
                                action='store_true', default=False,
                                action='store_true', default=False,
                                help='print statistics for the created archive')
                                help='print statistics for the created archive')
-        subparser.add_argument('-p', '--progress', dest='progress', const=not sys.stdin.isatty(),
+        subparser.add_argument('-p', '--progress', dest='progress', const=not sys.stderr.isatty(),
                                action='store_const', default=sys.stdin.isatty(),
                                action='store_const', default=sys.stdin.isatty(),
                                help="""toggle progress display while creating the archive, showing Original,
                                help="""toggle progress display while creating the archive, showing Original,
                                Compressed and Deduplicated sizes, followed by the Number of files seen
                                Compressed and Deduplicated sizes, followed by the Number of files seen