diff options
Diffstat (limited to 'furries.cpp')
-rw-r--r-- | furries.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/furries.cpp b/furries.cpp index 7e2f591..de2fa02 100644 --- a/furries.cpp +++ b/furries.cpp | |||
@@ -432,11 +432,18 @@ class fill_blanks { | |||
432 | 432 | ||
433 | int main(int argc, char** argv) | 433 | int main(int argc, char** argv) |
434 | { | 434 | { |
435 | if (argc != 2) | ||
436 | { | ||
437 | std::cout << "usage: furries [configfile]" << std::endl; | ||
438 | return -1; | ||
439 | } | ||
440 | |||
441 | std::string configfile(argv[1]); | ||
442 | YAML::Node config = YAML::LoadFile(configfile); | ||
443 | |||
435 | std::random_device random_device; | 444 | std::random_device random_device; |
436 | std::mt19937 random_engine{random_device()}; | 445 | std::mt19937 random_engine{random_device()}; |
437 | 446 | ||
438 | YAML::Node config = YAML::LoadFile("config.yml"); | ||
439 | |||
440 | twitter::auth auth; | 447 | twitter::auth auth; |
441 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 448 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |
442 | auth.setConsumerSecret(config["consumer_secret"].as<std::string>()); | 449 | auth.setConsumerSecret(config["consumer_secret"].as<std::string>()); |
@@ -444,7 +451,7 @@ int main(int argc, char** argv) | |||
444 | auth.setAccessSecret(config["access_secret"].as<std::string>()); | 451 | auth.setAccessSecret(config["access_secret"].as<std::string>()); |
445 | 452 | ||
446 | twitter::client client(auth); | 453 | twitter::client client(auth); |
447 | verbly::data database {"data.sqlite3"}; | 454 | verbly::data database {config["verbly_datafile"].as<std::string>()}; |
448 | 455 | ||
449 | for (;;) | 456 | for (;;) |
450 | { | 457 | { |