From a5fb30e194c88b90a092c16e3232e969fbe0813a Mon Sep 17 00:00:00 2001 From: dgelessus Date: Wed, 16 Oct 2019 23:29:20 +0200 Subject: [PATCH] Fix broken handling of - (stdin) file name on command line --- README.rst | 2 ++ rsrcfork/__main__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c006aac..42d35bf 100644 --- a/README.rst +++ b/README.rst @@ -182,6 +182,8 @@ Version 1.4.1 (next version) * The internal decompressor implementations have been refactored to use streams. * This allows for incremental decompression of compressed resource data. In practice this has no noticeable effect yet, because the main ``rsrcfork`` API doesn't support incremental reading of resource data. +* Fixed the command line tool always displaying an incorrect error "Cannot specify an explicit fork when reading from stdin" when using ``-`` (stdin) as the input file. + Version 1.4.0 ^^^^^^^^^^^^^ diff --git a/rsrcfork/__main__.py b/rsrcfork/__main__.py index 9e0141f..b01c310 100644 --- a/rsrcfork/__main__.py +++ b/rsrcfork/__main__.py @@ -423,7 +423,7 @@ def main() -> typing.NoReturn: ns = parse_args() if ns.file == "-": - if ns.fork is not None: + if ns.fork != "auto": print("Cannot specify an explicit fork when reading from stdin", file=sys.stderr) sys.exit(1)