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

«--no-remote-name» does not work #10564

Closed
u20221022 opened this issue Feb 19, 2023 · 5 comments
Closed

«--no-remote-name» does not work #10564

u20221022 opened this issue Feb 19, 2023 · 5 comments

Comments

@u20221022
Copy link

u20221022 commented Feb 19, 2023

I did this

  1. curl.exe --manual | FindStr /C:"or --no-remote-name" /N
    3957: all has been used, you must use "-o -" or --no-remote-name.

  2. curl.exe --head --output "head.txt" --no-remote-name "https://www.autohotkey.com/download/ahk-install.exe"
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 3269k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    Warning: Got more output options than URLs

  3. curl.exe --head --output "head.txt" --remote-name "https://www.autohotkey.com/download/ahk-install.exe"
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 3269k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    Warning: Got more output options than URLs

  4. curl.exe --head --output "head.txt" "https://www.autohotkey.com/download/ahk-install.exe"
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 3269k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0

  5. curl.exe --head --output "head.txt" --remote-name-all --no-remote-name "https://www.autohotkey.com/download/ahk-install.exe"
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 3269k 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    Warning: Got more output options than URLs

I expected the following

a) The capital letter «O» in case №0 («-O, --remote-name», not «-o, --output <file>»).
b) The same but without warnings in cases №1 and №4.

curl/libcurl version

7.88.0
[curl -V output]
curl 7.88.0 (x86_64-w64-mingw32) libcurl/7.88.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.52.0 ngtcp2/0.13.1 nghttp3/0.8.0 libgsasl/2.2.0
Release-Date: 2023-02-15
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 10

@u20221022 u20221022 changed the title «--no-remote-name» dos not work «--no-remote-name» does not work Feb 19, 2023
bagder added a commit that referenced this issue Feb 19, 2023
Reported-by: u20221022 on github
Fixes #10564
@bagder
Copy link
Member

bagder commented Feb 19, 2023

I see nothing in the man page that says --no-remote-name should work. The problem is rather that it doesn't complain about the option being used like that.

@u20221022
Copy link
Author

I see nothing in the man page that says --no-remote-name should work.

Repeat (with some extension) the case № 0:
curl.exe --manual | FindStr /C:"after --remote-name-" /C:"or --no-remote-name" /N
3956: you want to disable that for a specific URL after --remote-name-
3957: all has been used, you must use "-o -" or --no-remote-name.

Remove «--no-remote-name» from manual, if it is wrong.

The problem is rather that it doesn't complain about the option being used like that.

Sorry, I do not understand your English. Who is not complain?

@bagder
Copy link
Member

bagder commented Feb 20, 2023

I think the use case 1 and 4 are very strange so I even though the warnings are a little odd, I don't even know what the right action would be.

@jzakrzewski
Copy link
Contributor

I'd just error-out if someone gives multiple options for the output file name.

@u20221022
Copy link
Author

u20221022 commented Feb 20, 2023

the use case 1 and 4 are very strange

Recently, many errors have been found in the behavior of options. Therefore, I just reinsure myself by explicitly indicating all negative options. Do you remember the three states of the binary option: «--clobber», «--no-clobber» and «» (i.e. without option)?

Update. Case №5 («--remote-name-all» in case №4 is changed to «--NO-remote-name-all»):
curl.exe --head --output "head.txt" --no-remote-name-all --no-remote-name "https://www.autohotkey.com/download/ahk-install.exe"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 3269k 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
Warning: Got more output options than URLs

@curl curl deleted a comment from u20221022 Feb 20, 2023
@curl curl deleted a comment from u20221022 Feb 20, 2023
@curl curl deleted a comment from u20221022 Feb 20, 2023
bagder added a commit that referenced this issue Feb 21, 2023
Unless --remote-name-all is used.

Fixes #10564
Reported-by: u20221022 on github
@bagder bagder closed this as completed in 780ff2c Feb 22, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Unless --remote-name-all is used.

Fixes curl#10564
Reported-by: u20221022 on github
Closes curl#10582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants