changed to use start.txt as default, to be overridden by argv[1]
This commit is contained in:
parent
79715ad9df
commit
c4ade5ee09
6
main.cpp
6
main.cpp
@ -30,6 +30,8 @@ void print_version() {
|
|||||||
|
|
||||||
int main(int argc, const char * argv[]) {
|
int main(int argc, const char * argv[]) {
|
||||||
try {
|
try {
|
||||||
|
std::string base_url {"https://www.swiftcoder.nl/cpp1/"};
|
||||||
|
std::string next_url {"start.txt"};
|
||||||
int opt_char, opt_val;
|
int opt_char, opt_val;
|
||||||
struct option long_options[] = {
|
struct option long_options[] = {
|
||||||
{"help", no_argument, nullptr, 'h'},
|
{"help", no_argument, nullptr, 'h'},
|
||||||
@ -60,15 +62,13 @@ int main(int argc, const char * argv[]) {
|
|||||||
}
|
}
|
||||||
for (int i = optind; i < argc; ++i) {
|
for (int i = optind; i < argc; ++i) {
|
||||||
try {
|
try {
|
||||||
// process file argv[i]
|
next_url = argv[i];
|
||||||
} catch (const std::runtime_error& ex) {
|
} catch (const std::runtime_error& ex) {
|
||||||
std::cerr << "curly: " << ex.what() << '\n';
|
std::cerr << "curly: " << ex.what() << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool done {false};
|
bool done {false};
|
||||||
std::string base_url {"https://www.swiftcoder.nl/cpp1/"};
|
|
||||||
std::string next_url {"gcd.txt"};
|
|
||||||
std::string code;
|
std::string code;
|
||||||
requester req;
|
requester req;
|
||||||
interpreter proc;
|
interpreter proc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user