diff --git a/main.cpp b/main.cpp index 88a5997..08dd8ac 100644 --- a/main.cpp +++ b/main.cpp @@ -36,8 +36,16 @@ 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); } } auto in = input_data(cin, true);