From 92ac120fb060dc50a9875ae59718703a40aa1ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Fri, 16 Oct 2015 11:30:41 -0400 Subject: [PATCH] default progress display to true if on a tty this makes --progress a toggle: if there's a terminal, it turns it off, if there isn't, it forces it on. --- borg/archiver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/borg/archiver.py b/borg/archiver.py index 64e37d1cd..f1c9f8c00 100644 --- a/borg/archiver.py +++ b/borg/archiver.py @@ -677,11 +677,11 @@ Type "Yes I am sure" if you understand this and want to continue.\n""") subparser.add_argument('-s', '--stats', dest='stats', action='store_true', default=False, help='print statistics for the created archive') - subparser.add_argument('-p', '--progress', dest='progress', - action='store_true', default=False, - help="""print progress while creating the archive, showing Original, + subparser.add_argument('-p', '--progress', dest='progress', const=not sys.stdin.isatty(), + action='store_const', default=sys.stdin.isatty(), + help="""toggle progress display while creating the archive, showing Original, Compressed and Deduplicated sizes, followed by the Number of files seen - and the path being processd""") + and the path being processd, default: %(default)s""") subparser.add_argument('-e', '--exclude', dest='excludes', type=ExcludePattern, action='append', metavar="PATTERN", help='exclude paths matching PATTERN')