diff options
-rw-r--r-- | composite.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/composite.cpp b/composite.cpp index 49a2301..2b33fb1 100644 --- a/composite.cpp +++ b/composite.cpp | |||
@@ -8,7 +8,14 @@ | |||
8 | 8 | ||
9 | int main(int argc, char** argv) | 9 | int main(int argc, char** argv) |
10 | { | 10 | { |
11 | YAML::Node config = YAML::LoadFile("config.yml"); | 11 | if (argc != 2) |
12 | { | ||
13 | std::cout << "usage: composite [configfile]" << std::endl; | ||
14 | return -1; | ||
15 | } | ||
16 | |||
17 | std::string configfile(argv[1]); | ||
18 | YAML::Node config = YAML::LoadFile(configfile); | ||
12 | 19 | ||
13 | twitter::auth auth; | 20 | twitter::auth auth; |
14 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 21 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |
@@ -17,7 +24,7 @@ int main(int argc, char** argv) | |||
17 | auth.setAccessSecret(config["access_secret"].as<std::string>()); | 24 | auth.setAccessSecret(config["access_secret"].as<std::string>()); |
18 | 25 | ||
19 | twitter::client client(auth); | 26 | twitter::client client(auth); |
20 | verbly::data database("data.sqlite3"); | 27 | verbly::data database(config["verbly_datafile"].as<std::string>()); |
21 | 28 | ||
22 | for (;;) | 29 | for (;;) |
23 | { | 30 | { |