From 3da97fc4dbdd5418999645b58fd73c6ab8f6f5f4 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 13 Dec 2016 19:28:36 -0500 Subject: Bot now takes path to config file as argument --- manifesto.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'manifesto.cpp') diff --git a/manifesto.cpp b/manifesto.cpp index 6b59213..b81c66a 100644 --- a/manifesto.cpp +++ b/manifesto.cpp @@ -7,7 +7,14 @@ int main(int argc, char** argv) { - YAML::Node config = YAML::LoadFile("config.yml"); + if (argc != 2) + { + std::cout << "usage: manifesto [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()); @@ -47,7 +54,7 @@ int main(int argc, char** argv) loc += 140; { - std::ofstream fout("config.yml"); + std::ofstream fout(configfile); config["current_location"] = loc; fout << config; } -- cgit 1.4.1