From 3818146131026d7561e301ee04561a2d9790e3d8 Mon Sep 17 00:00:00 2001 From: Stepan Siniavskii Date: Mon, 5 Jun 2023 11:16:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 30767bf..d473dda 100644 --- a/main.cpp +++ b/main.cpp @@ -38,11 +38,20 @@ input_data(istream& inn, bool promt) { int main(int argc, char* argv[]) { curl_global_init(CURL_GLOBAL_ALL); - if (argc > 1){ - cout << argc << endl; - for(size_t i = 0; i < argc; i++){ - cout << "argv[" << i << "] = " << argv[0] << endl; + if (argc > 1) + { + CURL *curl = curl_easy_init(); + if(curl) + { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + if (res != CURLE_OK){ + cout << curl_easy_strerror; + exit(1); } + } return 0; } auto in = input_data(cin, true);