Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ testOutputFileName()
assertContains "Verify whether 'wcurl' correctly sets a custom output filename" "${ret}" 'test filename'
}

testOutputFileNameWithoutSpaces()
{
url='example.com'
ret=$(${WCURL_CMD} -o"test filename" ${url} 2>&1)
assertContains "Verify whether 'wcurl' correctly sets --output" "${ret}" '--output'
assertContains "Verify whether 'wcurl' correctly sets --output with the correct filename" "${ret}" 'test filename'
}

testOutputFileNameRepeatedOption()
{
url='example.com'
Expand Down
6 changes: 6 additions & 0 deletions wcurl
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ while [ -n "${1-}" ]; do
OUTPUT_PATH="${1}"
;;

-o*|-O*)
opt=$(printf "%s\n" "${1}" | sed 's/^-[oO]//')
HAS_USER_SET_OUTPUT="true"
OUTPUT_PATH="${opt}"
;;

--no-decode-filename)
DECODE_FILENAME="false"
;;
Expand Down