mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-26 09:19:02 +00:00
simplify processing for borg list --short
just use the respective format string.
This commit is contained in:
parent
d14e6f720c
commit
dc5467e9bc
1 changed files with 64 additions and 64 deletions
|
@ -438,17 +438,17 @@ def do_list(self, args):
|
|||
manifest, key = Manifest.load(repository)
|
||||
if args.location.archive:
|
||||
archive = Archive(repository, key, manifest, args.location.archive)
|
||||
if args.short:
|
||||
for item in archive.iter_items():
|
||||
print(remove_surrogates(item[b'path']))
|
||||
else:
|
||||
"""use_user_format flag is used to speed up default listing.
|
||||
When user issues format options, listing is a bit slower, but more keys are available and
|
||||
precalculated.
|
||||
"""
|
||||
use_user_format = args.listformat is not None
|
||||
list_format = args.listformat if use_user_format else \
|
||||
"{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{LF}"
|
||||
if use_user_format:
|
||||
list_format = args.listformat
|
||||
elif args.short:
|
||||
list_format = "{path}{LF}"
|
||||
else:
|
||||
list_format = "{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{LF}"
|
||||
|
||||
for item in archive.iter_items():
|
||||
mode = stat.filemode(item[b'mode'])
|
||||
|
|
Loading…
Reference in a new issue