diff options
Diffstat (limited to 'yandere.cpp')
| -rw-r--r-- | yandere.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
| diff --git a/yandere.cpp b/yandere.cpp index ec7322d..b9d42ec 100644 --- a/yandere.cpp +++ b/yandere.cpp | |||
| @@ -51,7 +51,14 @@ Container split(std::string input, std::string delimiter) | |||
| 51 | 51 | ||
| 52 | int main(int argc, char** argv) | 52 | int main(int argc, char** argv) |
| 53 | { | 53 | { |
| 54 | YAML::Node config = YAML::LoadFile("config.yml"); | 54 | if (argc != 2) |
| 55 | { | ||
| 56 | std::cout << "usage: yandere [configfile]" << std::endl; | ||
| 57 | return -1; | ||
| 58 | } | ||
| 59 | |||
| 60 | std::string configfile(argv[1]); | ||
| 61 | YAML::Node config = YAML::LoadFile(configfile); | ||
| 55 | 62 | ||
| 56 | twitter::auth auth; | 63 | twitter::auth auth; |
| 57 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 64 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |
| @@ -62,10 +69,10 @@ int main(int argc, char** argv) | |||
| 62 | twitter::client client(auth); | 69 | twitter::client client(auth); |
| 63 | 70 | ||
| 64 | std::map<std::string, std::vector<std::string>> groups; | 71 | std::map<std::string, std::vector<std::string>> groups; |
| 65 | std::ifstream datafile("data.txt"); | 72 | std::ifstream datafile(config["forms"].as<std::string>()); |
| 66 | if (!datafile.is_open()) | 73 | if (!datafile.is_open()) |
| 67 | { | 74 | { |
| 68 | std::cout << "Could not find data.txt" << std::endl; | 75 | std::cout << "Could not find forms file." << std::endl; |
| 69 | return 1; | 76 | return 1; |
| 70 | } | 77 | } |
| 71 | 78 | ||
