diff options
| -rw-r--r-- | manifesto.cpp | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/manifesto.cpp b/manifesto.cpp index 6b59213..b81c66a 100644 --- a/manifesto.cpp +++ b/manifesto.cpp | |||
| @@ -7,7 +7,14 @@ | |||
| 7 | 7 | ||
| 8 | int main(int argc, char** argv) | 8 | int main(int argc, char** argv) | 
| 9 | { | 9 | { | 
| 10 | YAML::Node config = YAML::LoadFile("config.yml"); | 10 | if (argc != 2) | 
| 11 | { | ||
| 12 | std::cout << "usage: manifesto [configfile]" << std::endl; | ||
| 13 | return -1; | ||
| 14 | } | ||
| 15 | |||
| 16 | std::string configfile(argv[1]); | ||
| 17 | YAML::Node config = YAML::LoadFile(configfile); | ||
| 11 | 18 | ||
| 12 | twitter::auth auth; | 19 | twitter::auth auth; | 
| 13 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 20 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 
| @@ -47,7 +54,7 @@ int main(int argc, char** argv) | |||
| 47 | 54 | ||
| 48 | loc += 140; | 55 | loc += 140; | 
| 49 | { | 56 | { | 
| 50 | std::ofstream fout("config.yml"); | 57 | std::ofstream fout(configfile); | 
| 51 | config["current_location"] = loc; | 58 | config["current_location"] = loc; | 
| 52 | fout << config; | 59 | fout << config; | 
| 53 | } | 60 | } | 
