From 26425968306ee3c2119693f475eb155e9d93eddd Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 13 Dec 2016 18:52:22 -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. --- composite.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'composite.cpp') diff --git a/composite.cpp b/composite.cpp index 49a2301..2b33fb1 100644 --- a/composite.cpp +++ b/composite.cpp @@ -8,7 +8,14 @@ int main(int argc, char** argv) { - YAML::Node config = YAML::LoadFile("config.yml"); + if (argc != 2) + { + std::cout << "usage: composite [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()); @@ -17,7 +24,7 @@ int main(int argc, char** argv) auth.setAccessSecret(config["access_secret"].as()); twitter::client client(auth); - verbly::data database("data.sqlite3"); + verbly::data database(config["verbly_datafile"].as()); for (;;) { -- cgit 1.4.1