diff --git a/main.cpp b/main.cpp index 0a93313..4c4dbf2 100644 --- a/main.cpp +++ b/main.cpp @@ -37,13 +37,15 @@ Input input_data(istream& in, bool prompt) { int main(int argc, char* argv[]) { curl_global_init(CURL_GLOBAL_ALL); if (argc > 1) { - for (size_t i = 0; i < argc; i++) { - cerr << "argv [" << i << "] = " << argv[i]; CURL* curl = curl_easy_init(); if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, argv[1]); res = curl_easy_perform(curl); + if (res != CURLE_OK){ + cerr << curl_easy_strerror(res); + exit(1); + } curl_easy_cleanup(curl); } }