From c4ade5ee096db0b94eae9ec98653d2feaa8cb5ae Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 9 Sep 2020 18:29:17 +0200 Subject: [PATCH] changed to use start.txt as default, to be overridden by argv[1] --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 2ff9f2a..ee16f89 100644 --- a/main.cpp +++ b/main.cpp @@ -30,6 +30,8 @@ void print_version() { int main(int argc, const char * argv[]) { try { + std::string base_url {"https://www.swiftcoder.nl/cpp1/"}; + std::string next_url {"start.txt"}; int opt_char, opt_val; struct option long_options[] = { {"help", no_argument, nullptr, 'h'}, @@ -60,15 +62,13 @@ int main(int argc, const char * argv[]) { } for (int i = optind; i < argc; ++i) { try { - // process file argv[i] + next_url = argv[i]; } catch (const std::runtime_error& ex) { std::cerr << "curly: " << ex.what() << '\n'; } } bool done {false}; - std::string base_url {"https://www.swiftcoder.nl/cpp1/"}; - std::string next_url {"gcd.txt"}; std::string code; requester req; interpreter proc;