From 41caebf71f6fb937ae42766622bdb1642f032c08 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 13 Dec 2016 19:07:19 -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. --- furries.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'furries.cpp') diff --git a/furries.cpp b/furries.cpp index 7e2f591..de2fa02 100644 --- a/furries.cpp +++ b/furries.cpp @@ -432,11 +432,18 @@ class fill_blanks { int main(int argc, char** argv) { + if (argc != 2) + { + std::cout << "usage: furries [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + YAML::Node config = YAML::LoadFile(configfile); + std::random_device random_device; std::mt19937 random_engine{random_device()}; - YAML::Node config = YAML::LoadFile("config.yml"); - twitter::auth auth; auth.setConsumerKey(config["consumer_key"].as()); auth.setConsumerSecret(config["consumer_secret"].as()); @@ -444,7 +451,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