From 1c9617daeb732ed0dd943a4393e3f4d0c255b31c Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 31 Aug 2015 23:47:25 +0200 Subject: [PATCH] Rez: --data option for importing data fork --- Rez/Rez.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Rez/Rez.cc b/Rez/Rez.cc index 09dbb4f6ed..2b123bd3ec 100644 --- a/Rez/Rez.cc +++ b/Rez/Rez.cc @@ -51,6 +51,7 @@ int main(int argc, const char *argv[]) ("copy", po::value>(), "copy resources from other resource file") ("cc", po::value>(), "also write output to another file") ("debug,d", "debug logging") + ("data", po::value(), "copy data fork from another file") ; po::options_description hidden, alldesc; hidden.add_options() @@ -98,6 +99,16 @@ int main(int argc, const char *argv[]) world.getResources().addResources(rsrcFile.resources); } + + if(options.count("data")) + { + std::string fn = options["data"].as(); + ResourceFile dataFile(fn); + if(!dataFile.read()) + world.problem(Diagnostic(Diagnostic::error, "Could not read dataresource file " + fn, yy::location())); + rsrcFile.data = dataFile.data; + } + if(options.count("copy")) for(std::string fn : options["copy"].as>()) CopyBinaryResources(world, fn);