timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
424 stars 123 forks source link

--progress fails with recent curl #118

Open geoffk02 opened 1 year ago

geoffk02 commented 1 year ago

The --progress command line option fails with 'aws put' (eg. 'aws --progress put bucket/file file'), producing

curl: option --progress: is ambiguous curl: try 'curl --help' or 'curl --manual' for more information

This happens with

curl 7.87.0 (x86_64-apple-darwin20.0) libcurl/7.87.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.41.0 Release-Date: 2022-12-21

It appears curl wants either --progress-meter or --progress-bar. I think this changed in curl 7.67.0 with https://github.com/curl/curl/pull/4470 which added --progress-meter.

I worked around this by changing

$curl_options .= $progress? " --progress": " -s";

to

$curl_options .= $progress? " --progress-meter": " -s";

It's possible the right thing here is to also change " -s" to be " --no-progress-meter", so that warnings from curl make it to the error output. Alternatively if backwards compatibility with earlier versions of curl is desired, you could use --progress-bar which dates from 2009 and I think is what the existing code would have invoked.