Skip to content

The --no- prefix for non-booleans command line options is silently ignored #1453

@darnir

Description

@darnir

I did this

Execute curl with the option --no-http2. E.g.:
$ curl --no-http2 example.com

I expected the following

I expect curl to continue running. However, instead curl returns an error:

curl: (1) Unsupported protocol

My version of curl is built without HTTP/2 support. However, the binary should still support the --no-http2 flag without any issues. The use case for this is usage of curl in a script where one wants to avoid a HTTP/2 connection. Such a script ends up failing on systems where curl is built without HTTP/2 support anyways.

curl/libcurl version

curl 7.54.0 (x86_64-pc-linux-gnu) libcurl/7.54.0 OpenSSL/1.1.0e zlib/1.2.11 libpsl/0.17.0 (+libicu/58.2) libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL

operating system

Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions