output_fd = open_output_file(cl->url->location, true);
if (output_fd < 0) {
- if (!quiet) {
+ if (!quiet)
perror("Cannot open output file");
- error_ret = 3;
- uloop_end();
- }
+ error_ret = 3;
+ uclient_disconnect(cl);
+ uloop_end();
}
}
fprintf(stderr,
"Usage: %s [options] <URL>\n"
"Options:\n"
+ " -O <file>: Redirect output to file (use \"-\" for stdout)\n"
"\n"
"HTTPS options:\n"
" --ca-certificate=<cert>: Load CA certificates from file <cert>\n"