Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--version followed by --no-version does not turn off version output #10490

Closed
u20221022 opened this issue Feb 13, 2023 · 7 comments
Closed

--version followed by --no-version does not turn off version output #10490

u20221022 opened this issue Feb 13, 2023 · 7 comments
Labels
cmdline tool not-a-bug This is not a bug in curl

Comments

@u20221022
Copy link

I did this

curl.exe --version --no-version "https://curl.se/"

I expected the following

Какой-нибудь глюк типа «not-a-bug» (#10459 и другие). Иначе не стал бы время тратить на такую примитивную проверку.
«Верной дорогой идёте, товарищи!»©

curl/libcurl version

7.87.0
[curl -V output]
curl 7.87.0 (x86_64-w64-mingw32) libcurl/7.87.0 OpenSSL/3.0.8 (Schannel) zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 WinIDN libssh2/1.10.0 nghttp2/1.51.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0
Release-Date: 2022-12-21
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI threadsafe TLS-SRP UnixSockets zstd

operating system

MS Windows

@jay jay changed the title --version --no-version --version followed by --no-version does not turn off version output Feb 13, 2023
@jay
Copy link
Member

jay commented Feb 13, 2023

Please tell us in English. I think you are saying you expect --version followed by --no-version to turn off version output? The code says there is not supposed to be output for --no-version, but if --version was already specified it's too late because the code is going to show the version output and not parse --no-version. I'm tempted to leave this as is.

curl/src/tool_getparam.c

Lines 2353 to 2356 in 7ce140b

case 'V':
if(toggle) /* --no-version yields no output! */
return PARAM_VERSION_INFO_REQUESTED;
break;

@jzakrzewski
Copy link
Contributor

In many tools specifying "-V" / "--version" causes complete different code path that disregards any other parameter and just shows the version. So I think it's OK how it it.

@bagder
Copy link
Member

bagder commented Feb 13, 2023

I don't think this is a bug.

@bagder bagder added the not-a-bug This is not a bug in curl label Feb 13, 2023
@u20221022
Copy link
Author

«Disable it again with --no-version.»(©curl --manual)

I don't think this is a bug.

Me too. I think it is a lie.

@bagder
Copy link
Member

bagder commented Feb 13, 2023

It would help us if you actually explained what you talk about.

I now assume you talk about text in the curl man page that says --no-version works. It does indeed say this because it is automatically added because how the option is said to work: Multi: boolean.

@u20221022
Copy link
Author

Sorry, I do not know English well and I do not quite understand you (in particular: «Multi: boolean»).

Binary options or not:
--version/--no-version
--manual/--no-manual
--help/--no-help

Correct the manual, please.

bagder added a commit that referenced this issue Feb 13, 2023
Instead of using "multi: boolean", as these are slightly special as in
they do are not enable/disable ones.

Fixes #10490
Reported-by: u20221022 on github
@u20221022
Copy link
Author

What about this:
curl.exe -I --silent --no-silent "htps://curl.se/"
curl.exe -I --no-silent --silent "htps://curl.se/"

«So I think it's OK how it it.»(©jzakrzewski)

@bagder bagder closed this as completed in daf4e6a Feb 13, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Instead of using "multi: boolean", as these are slightly special as in
they do are not enable/disable ones.

Fixes curl#10490
Reported-by: u20221022 on github
Closes curl#10497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmdline tool not-a-bug This is not a bug in curl
Development

No branches or pull requests

4 participants