main
KlimecnhenkoIA 3 недель назад
Родитель 15427be716
Сommit 771ba3bf94

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

Загрузка…
Отмена
Сохранить