diff --git a/README.md b/README.md index 7c03fdc..a6391ad 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ should be using curl directly if your use case is not covered. # Options - * `--curl-options, curl-options=`... Specify extra options to be passed when invoking curl. May be specified more than once. @@ -58,7 +57,8 @@ should be using curl directly if your use case is not covered. Use the provided output path instead of getting it from the URL. If multiple URLs are provided, all files will have the same name with a number appended to - the end (curl >= 7.83.0). + the end (curl >= 7.83.0). If this option is provided multiple times, only the + last value is considered. * `--no-decode-filename` Don't percent-decode the output filename, even if the percent-encoding in the diff --git a/tests/tests.sh b/tests/tests.sh index e34db4d..0cf0356 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -120,6 +120,14 @@ testOutputFileName() assertContains "Verify whether 'wcurl' correctly sets a custom output filename" "${ret}" 'test filename' } +testOutputFileNameRepeatedOption() +{ + url='example.com' + ret=$(${WCURL_CMD} -o "test filename" -o "test filename2" ${url} 2>&1) + assertContains "Verify whether 'wcurl' correctly sets a custom output filename" "${ret}" '--output' + assertContains "Verify whether 'wcurl' correctly sets a custom output filename" "${ret}" 'test filename2' +} + testUrlDefaultName() { url='example%20with%20spaces.com' diff --git a/wcurl b/wcurl index a4f9f2e..09e2c4c 100755 --- a/wcurl +++ b/wcurl @@ -61,7 +61,8 @@ Options: -o, -O, --output : Use the provided output path instead of getting it from the URL. If multiple URLs are provided, all files will have the same name with a - number appended to the end (curl >= 7.83.0). + number appended to the end (curl >= 7.83.0). If this option is provided + multiple times, only the last value is considered. --no-decode-filename: Don't percent-decode the output filename, even if the percent-encoding in the URL was done by wcurl, e.g.: The URL contained whitespaces. diff --git a/wcurl.1 b/wcurl.1 index 9e29253..364aa57 100644 --- a/wcurl.1 +++ b/wcurl.1 @@ -76,7 +76,8 @@ Specify extra options to be passed when invoking curl. May be specified more tha \fB\-o, \-O, \-\-output=\fI\fR...\fR Use the provided output path instead of getting it from the URL. If multiple URLs are provided, all files will have the same name with a number appended to -the end (curl >= 7.83.0). +the end (curl >= 7.83.0). If this option is provided multiple times, only the +last value is considered. .TP \fB\-\-dry\-run\fR Don't actually execute curl, just print what would be invoked.