tool_getparam: add support for --longopt=value

If the long option name ends with an equals sign (`=`), the argument is
the text following on its right side.

This makes the command line parser accept this common style in addition
to the existing way to accept option arguments more similar to how other
command line tools do.

Example: `curl --user-agent=curl-2000 https://example.com/`

Change a few existing tests to use this syntax: 206, 1333, 1335, 1442

Closes #17789
This commit is contained in:
Daniel Stenberg 2025-06-30 23:53:29 +02:00
parent 378713deb2
commit 9f9fecc724
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 29 additions and 6 deletions

View file

@ -31,7 +31,7 @@ http
HTTP POST zero length, chunked-encoded
</name>
<command>
-d "" --header "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/%TESTNUMBER
-d "" --header="Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>

View file

@ -30,7 +30,7 @@ http
HTTP GET with -O without Content-Disposition, -D stdout
</name>
<command option="no-output,no-include">
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir %LOGDIR
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -O -D - --output-dir="%LOGDIR"
</command>
</client>

View file

@ -19,7 +19,7 @@ file
Check --write-out with trailing \
</name>
<command>
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '\'
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out='\'
</command>
</client>

View file

@ -80,7 +80,7 @@ digest
HTTP proxy CONNECT auth Digest
</name>
<command>
http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-digest --proxytunnel
http://test.remote.haxx.se.%TESTNUMBER:8990/path/%TESTNUMBER0002 --proxy=http://%HOSTIP:%HTTPPORT --proxy-user=silly:person --proxy-digest --proxytunnel
</command>
</client>