From a56e585703a12e30af6b62e5e6ac8a9891d7610f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 13 Dec 2016 19:36:26 -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. --- owo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'owo.cpp') diff --git a/owo.cpp b/owo.cpp index d6b3043..f66e689 100644 --- a/owo.cpp +++ b/owo.cpp @@ -8,7 +8,14 @@ int main(int argc, char** argv) { - YAML::Node config = YAML::LoadFile("config.yml"); + if (argc != 2) + { + std::cout << "usage: owo [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()); @@ -18,7 +25,7 @@ int main(int argc, char** argv) twitter::client client(auth); - verbly::data database {"data.sqlite3"}; + verbly::data database {config["verbly_datafile"].as()}; verbly::noun bp = database.nouns().with_wnid(105220461).run().front(); // body part verbly::noun pp = database.nouns().with_wnid(104723816).run().front(); // quality -- cgit 1.4.1