Allow specifying multiple Python files on the command line

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-06-07 09:01:30 +02:00
parent bdd9313582
commit 0f6ebd6384

View File

@ -53,7 +53,7 @@ int main(int argc, char *argv[])
options.add_options()("test","just a check");
options.add_options()("gui","start gui");
options.add_options()("svg","dump SVG file");
options.add_options()("file", po::value<std::string>(), "python file to execute");
options.add_options()("file", po::value<std::vector<std::string>>(), "python file to execute");
options.add_options()("json", po::value<std::string>(), "JSON design file to ingest");
options.add_options()("version,v","show version");
options.add_options()("lp384","set device type to iCE40LP384");
@ -207,8 +207,9 @@ int main(int argc, char *argv[])
if (vm.count("file"))
{
std::string filename = vm["file"].as<std::string>();
execute_python_file(filename.c_str());
std::vector<std::string> files = vm["file"].as<std::vector<std::string>>();
for(auto filename : files)
execute_python_file(filename.c_str());
}
if (vm.count("gui"))