mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-22 19:30:36 +00:00
Rez: --cc option - provide "carbon copies" of the output in other formats
This commit is contained in:
parent
f9b893765c
commit
4957426613
22
Rez/Rez.cc
22
Rez/Rez.cc
@ -34,6 +34,7 @@ int main(int argc, const char *argv[])
|
||||
("define,D", po::value<std::vector<std::string>>(), "predefine preprocessor symbol")
|
||||
("include,I", po::value<std::vector<std::string>>(), "add include file path")
|
||||
("copy", po::value<std::vector<std::string>>(), "copy resources from other resource file")
|
||||
("cc", po::value<std::vector<std::string>>(), "also write output to another file")
|
||||
("debug,d", "debug logging")
|
||||
;
|
||||
po::options_description hidden, alldesc;
|
||||
@ -48,8 +49,7 @@ int main(int argc, const char *argv[])
|
||||
auto parsed = po::command_line_parser(argc, argv)
|
||||
.options(alldesc)
|
||||
.positional(po::positional_options_description().add("input", -1))
|
||||
.style(po::command_line_style::default_style |
|
||||
po::command_line_style::allow_long_disguise)
|
||||
.style(po::command_line_style::default_style)
|
||||
.run();
|
||||
|
||||
po::store(parsed, options);
|
||||
@ -94,6 +94,16 @@ int main(int argc, const char *argv[])
|
||||
|
||||
if(options.count("input"))
|
||||
for(std::string fn : options["input"].as<std::vector<std::string>>())
|
||||
{
|
||||
fs::path path(fn);
|
||||
if(path.extension() == ".rsrc" || path.extension() == ".bin")
|
||||
{
|
||||
ResourceFile copyRsrc(fn);
|
||||
|
||||
copyRsrc.read();
|
||||
world.getResources().addResources(copyRsrc.resources);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -115,6 +125,7 @@ int main(int argc, const char *argv[])
|
||||
world.problem(Diagnostic(Diagnostic::fatalError,"unknown error",yy::location(&fn)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(world.hadErrors)
|
||||
return 1;
|
||||
@ -124,5 +135,12 @@ int main(int argc, const char *argv[])
|
||||
rsrcFile.type = options["type"].as<std::string>();
|
||||
rsrcFile.write();
|
||||
|
||||
if(options.count("cc"))
|
||||
for(std::string ccFile : options["cc"].as<std::vector<std::string>>())
|
||||
{
|
||||
rsrcFile.assign(ccFile);
|
||||
rsrcFile.write();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user