about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--wordplay.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/wordplay.cpp b/wordplay.cpp index dedd812..c7015ee 100644 --- a/wordplay.cpp +++ b/wordplay.cpp
@@ -10,7 +10,14 @@
10 10
11int main(int argc, char** argv) 11int main(int argc, char** argv)
12{ 12{
13 YAML::Node config = YAML::LoadFile("config.yml"); 13 if (argc != 2)
14 {
15 std::cout << "usage: wordplay [configfile]" << std::endl;
16 return -1;
17 }
18
19 std::string configfile(argv[1]);
20 YAML::Node config = YAML::LoadFile(configfile);
14 21
15 twitter::auth auth; 22 twitter::auth auth;
16 auth.setConsumerKey(config["consumer_key"].as<std::string>()); 23 auth.setConsumerKey(config["consumer_key"].as<std::string>());
@@ -20,7 +27,7 @@ int main(int argc, char** argv)
20 27
21 twitter::client client(auth); 28 twitter::client client(auth);
22 29
23 verbly::data database("data.sqlite3"); 30 verbly::data database(config["verbly_datafile"].as<std::string>());
24 31
25 for (;;) 32 for (;;)
26 { 33 {