From 99fe6c21ad757c41e4c082fadaa47c79a93c10c5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 14 Dec 2016 02:19:59 -0500 Subject: Bot now takes path to config file as argument --- toldya.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toldya.cpp b/toldya.cpp index 5f05b20..d880c81 100644 --- a/toldya.cpp +++ b/toldya.cpp @@ -9,7 +9,14 @@ int main(int argc, char** argv) { - YAML::Node config = YAML::LoadFile("config.yml"); + if (argc != 2) + { + std::cout << "usage: toldya [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()); -- cgit 1.4.1