From ec5eb3bcc1a3449b76614e1f9232cb94b451a65d Mon Sep 17 00:00:00 2001 From: dgelessus Date: Tue, 22 Oct 2019 13:26:03 +0200 Subject: [PATCH] Don't display header data and attributes in list output This is redundant now that there is a dedicated info subcommand. --- rsrcfork/__main__.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rsrcfork/__main__.py b/rsrcfork/__main__.py index f2baaef..b0d1385 100644 --- a/rsrcfork/__main__.py +++ b/rsrcfork/__main__.py @@ -364,18 +364,6 @@ def show_filtered_resources(resources: typing.Sequence[api.Resource], format: st raise ValueError(f"Unhandled output format: {format}") def list_resource_file(rf: api.ResourceFile, *, sort: bool, group: str, decompress: bool) -> None: - if rf.header_system_data != bytes(len(rf.header_system_data)): - print("Header system data:") - hexdump(rf.header_system_data) - - if rf.header_application_data != bytes(len(rf.header_application_data)): - print("Header application data:") - hexdump(rf.header_application_data) - - attrs = decompose_flags(rf.file_attributes) - if attrs: - print("File attributes: " + " | ".join(attr.name for attr in attrs)) - if len(rf) == 0: print("No resources (empty resource file)") return @@ -470,6 +458,18 @@ def main_old(args: typing.List[str]) -> typing.NoReturn: print('Please use "rsrcfork list " instead of "rsrcfork ".', file=sys.stderr) print(file=sys.stderr) + if rf.header_system_data != bytes(len(rf.header_system_data)): + print("Header system data:") + hexdump(rf.header_system_data) + + if rf.header_application_data != bytes(len(rf.header_application_data)): + print("Header application data:") + hexdump(rf.header_application_data) + + attrs = decompose_flags(rf.file_attributes) + if attrs: + print("File attributes: " + " | ".join(attr.name for attr in attrs)) + list_resource_file(rf, sort=ns.sort, group=ns.group, decompress=ns.decompress) sys.exit(0)