From af20d60f42cc2046090c41cafc7f3d651cd0997d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 14 Dec 2016 02:23:18 -0500 Subject: Bot now takes path to config file as argument That config file now also has to contain the path to the verbly datafile. --- wordplay.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wordplay.cpp b/wordplay.cpp index dedd812..c7015ee 100644 --- a/wordplay.cpp +++ b/wordplay.cpp @@ -10,7 +10,14 @@ int main(int argc, char** argv) { - YAML::Node config = YAML::LoadFile("config.yml"); + if (argc != 2) + { + std::cout << "usage: wordplay [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + YAML::Node config = YAML::LoadFile(configfile); twitter::auth auth; auth.setConsumerKey(config["consumer_key"].as()); @@ -20,7 +27,7 @@ int main(int argc, char** argv) twitter::client client(auth); - verbly::data database("data.sqlite3"); + verbly::data database(config["verbly_datafile"].as()); for (;;) { -- cgit 1.4.1