use kb passed in from args

This commit is contained in:
Chris Cromer 2023-02-08 10:17:58 -03:00
parent 691b7963e3
commit e77fb73cd0
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
2 changed files with 4 additions and 4 deletions

View File

@ -9,14 +9,14 @@
#include <limits>
#include <memory>
static int obelisk::mainLoop()
static int obelisk::mainLoop(const std::vector<std::string>& sourceFiles, const std::string& kbFile)
{
auto parser = std::unique_ptr<obelisk::Parser> {new obelisk::Parser()};
std::unique_ptr<obelisk::KnowledgeBase> kb;
try
{
kb = std::unique_ptr<obelisk::KnowledgeBase> {new obelisk::KnowledgeBase("cromer.kb")};
kb = std::unique_ptr<obelisk::KnowledgeBase> {new obelisk::KnowledgeBase(kbFile.c_str())};
}
catch (obelisk::KnowledgeBaseException& exception)
{
@ -131,5 +131,5 @@ int main(int argc, char** argv)
return 0;
return obelisk::mainLoop();
return obelisk::mainLoop(sourceFiles, kbFile);
}

View File

@ -42,5 +42,5 @@ Options:
*
* @return int Returns EXIT_SUCCESS or EXIT_FAILURE.
*/
static int mainLoop();
static int mainLoop(const std::vector<std::string> &sourceFiles, const std::string &kbFile);
} // namespace obelisk