Wrote simple dummy parser.

This commit is contained in:
2016-11-22 03:15:52 +01:00
parent 14acaea28a
commit 7e7baa1aab
7 changed files with 367 additions and 1 deletions

View File

@@ -2,6 +2,8 @@
#include <boost/program_options.hpp>
#include <anthem/Translation.h>
int main(int argc, char **argv)
{
namespace po = boost::program_options;
@@ -37,7 +39,7 @@ int main(int argc, char **argv)
}
catch (const po::error &e)
{
std::cerr << e.what() << std::endl;
std::cerr << "error: " << e.what() << std::endl;
printHelp();
return EXIT_FAILURE;
}
@@ -54,5 +56,21 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
try
{
if (variablesMap.count("input"))
{
const auto &inputFiles = variablesMap["input"].as<std::vector<std::string>>();
anthem::translate(inputFiles);
}
else
anthem::translate("std::cin", std::cin);
}
catch (const std::exception &e)
{
std::cerr << "error: " << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}