diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-14 02:19:59 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-14 02:19:59 -0500 |
commit | 99fe6c21ad757c41e4c082fadaa47c79a93c10c5 (patch) | |
tree | 60463518d15a36ad4ef235dc2e77066bb3d3295e | |
parent | cfab478279732f86476e361e937da5fde495d326 (diff) | |
download | toldya-99fe6c21ad757c41e4c082fadaa47c79a93c10c5.tar.gz toldya-99fe6c21ad757c41e4c082fadaa47c79a93c10c5.tar.bz2 toldya-99fe6c21ad757c41e4c082fadaa47c79a93c10c5.zip |
Bot now takes path to config file as argument
-rw-r--r-- | toldya.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/toldya.cpp b/toldya.cpp index 5f05b20..d880c81 100644 --- a/toldya.cpp +++ b/toldya.cpp | |||
@@ -9,7 +9,14 @@ | |||
9 | 9 | ||
10 | int main(int argc, char** argv) | 10 | int main(int argc, char** argv) |
11 | { | 11 | { |
12 | YAML::Node config = YAML::LoadFile("config.yml"); | 12 | if (argc != 2) |
13 | { | ||
14 | std::cout << "usage: toldya [configfile]" << std::endl; | ||
15 | return -1; | ||
16 | } | ||
17 | |||
18 | std::string configfile(argv[1]); | ||
19 | YAML::Node config = YAML::LoadFile(configfile); | ||
13 | 20 | ||
14 | twitter::auth auth; | 21 | twitter::auth auth; |
15 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 22 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |