From 6fbb91928505a36fe934866713ff4c572d419dd7 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Tue, 22 Oct 2019 10:46:25 +0200 Subject: [PATCH] Display warnings when the old CLI syntax is used --- rsrcfork/__main__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rsrcfork/__main__.py b/rsrcfork/__main__.py index 9b39479..ef43bf1 100644 --- a/rsrcfork/__main__.py +++ b/rsrcfork/__main__.py @@ -433,17 +433,31 @@ def main_old(args: typing.List[str]) -> typing.NoReturn: rf = api.ResourceFile.open(ns.file, fork=ns.fork) with rf: + print("Warning: The syntax of the rsrcfork command has changed.", file=sys.stderr) + if ns.header_system or ns.header_application: if ns.header_system: + print('Please use "rsrcfork read-header --part=system " instead of "rsrcfork --header-system ".', file=sys.stderr) + print(file=sys.stderr) + data = rf.header_system_data else: + print('Please use "rsrcfork read-header --part=application " instead of "rsrcfork --header-application ".', file=sys.stderr) + print(file=sys.stderr) + data = rf.header_application_data show_header_data(data, format=ns.format) elif ns.filter or ns.all: if ns.filter: + print('Please use "rsrcfork read " instead of "rsrcfork ".', file=sys.stderr) + print(file=sys.stderr) + resources = filter_resources(rf, ns.filter) else: + print('Please use "rsrcfork read " instead of "rsrcfork --all".', file=sys.stderr) + print(file=sys.stderr) + resources = [] for reses in rf.values(): resources.extend(reses.values()) @@ -453,6 +467,9 @@ def main_old(args: typing.List[str]) -> typing.NoReturn: show_filtered_resources(resources, format=ns.format, decompress=ns.decompress) else: + print('Please use "rsrcfork list " instead of "rsrcfork ".', file=sys.stderr) + print(file=sys.stderr) + list_resource_file(rf, sort=ns.sort, group=ns.group, decompress=ns.decompress) sys.exit(0)