also show the number of files processed in --progress

This commit is contained in:
Antoine Beaupré 2015-10-15 21:13:59 -04:00
parent 3eebea8745
commit 3827c2b107
2 changed files with 5 additions and 6 deletions

View File

@ -670,10 +670,9 @@ Type "Yes I am sure" if you understand this and want to continue.\n""")
help='print statistics for the created archive') help='print statistics for the created archive')
subparser.add_argument('-p', '--progress', dest='progress', subparser.add_argument('-p', '--progress', dest='progress',
action='store_true', default=False, action='store_true', default=False,
help="""print progress while creating help="""print progress while creating the archive, showing Original,
the archive, showing Original, Compressed and Deduplicated sizes, followed by the Number of files seen
Compressed and Deduplicated sizes, and the path being processd""")
followed by the path being processd""")
subparser.add_argument('-e', '--exclude', dest='excludes', subparser.add_argument('-e', '--exclude', dest='excludes',
type=ExcludePattern, action='append', type=ExcludePattern, action='append',
metavar="PATTERN", help='exclude paths matching PATTERN') metavar="PATTERN", help='exclude paths matching PATTERN')

View File

@ -177,8 +177,8 @@ class Statistics:
path = remove_surrogates(item[b'path']) if item else '' path = remove_surrogates(item[b'path']) if item else ''
if len(path) > 43: if len(path) > 43:
path = '%s...%s' % (path[:20], path[-20:]) path = '%s...%s' % (path[:20], path[-20:])
msg = '%9s O %9s C %9s D %-43s' % ( msg = '%9s O %9s C %9s D %d N %-43s' % (
format_file_size(self.osize), format_file_size(self.csize), format_file_size(self.usize), path) format_file_size(self.osize), format_file_size(self.csize), format_file_size(self.usize), self.nfiles, path)
else: else:
msg = ' ' * 79 msg = ' ' * 79
print(msg, file=sys.stderr, end='\r') print(msg, file=sys.stderr, end='\r')