From 1bd96685bca63406bd4748a36fa4ccd348436999 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 24 Oct 2016 17:19:07 +0200 Subject: [PATCH] Allow passing - as filename to egg tools to read from stdin --- pandatool/src/eggbase/eggReader.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandatool/src/eggbase/eggReader.cxx b/pandatool/src/eggbase/eggReader.cxx index 2c2d2a0a0e..72d0007fb3 100644 --- a/pandatool/src/eggbase/eggReader.cxx +++ b/pandatool/src/eggbase/eggReader.cxx @@ -170,11 +170,17 @@ handle_args(ProgramBase::Args &args) { Filename filename = Filename::from_os_specific(*ai); EggData file_data; - if (!file_data.read(filename)) { - // Rather than returning false, we simply exit here, so the ProgramBase - // won't try to tell the user how to run the program just because we got - // a bad egg file. - exit(1); + if (filename != "-") { + if (!file_data.read(filename)) { + // Rather than returning false, we simply exit here, so the ProgramBase + // won't try to tell the user how to run the program just because we got + // a bad egg file. + exit(1); + } + } else { + if (!file_data.read(cin)) { + exit(1); + } } if (_noabs && file_data.original_had_absolute_pathnames()) {