Added support for input from std::cin.
This commit is contained in:
parent
082235eaaf
commit
441b8b0154
@ -57,16 +57,12 @@ int main(int argc, char **argv)
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!variablesMap.count("input"))
|
|
||||||
{
|
|
||||||
std::cerr << "Error: No input file specified" << std::endl << std::endl;
|
|
||||||
printHelp();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const auto sasDescription = plasp::sas::Description::fromFile(variablesMap["input"].as<std::string>());
|
const auto sasDescription = variablesMap.count("input")
|
||||||
|
? plasp::sas::Description::fromFile(variablesMap["input"].as<std::string>())
|
||||||
|
: plasp::sas::Description::fromStream(std::cin);
|
||||||
|
|
||||||
const auto sasTranslator = plasp::sas::TranslatorASP(sasDescription);
|
const auto sasTranslator = plasp::sas::TranslatorASP(sasDescription);
|
||||||
sasTranslator.translate(std::cout);
|
sasTranslator.translate(std::cout);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user