-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
error out if --next is used without a prior URL #10782
Conversation
Reported-by: 積丹尼 Dan Jacobson Ref: #10769 (comment)
All I know is I see "error out if --next is used without a prior URL". It is really hard to tell using my small computer screens what is happening in the code. So I'll just have to rely on the titles. If you are making --next more forgiving, that's good! If the latter is the case, then I was going to say the following, which maybe isn't now necessary: I am saying just like perl -we 'for(1){next; next; next;}' does it produce an error? No. Not even a warning. So --next should just do the job that it says it does on the command Currently it has an unnecessary internal check that there must be a URL Please eliminate this unnecessary check and resultant error. Now you want to even add another unnecessary check: to make sure there Please don't add that unnecessary check either. Just like the perl example above, the next should simply mind its own So what about
Well, the --next should simply wipe out the -w, Anyway, let's take a look at a real life config file producer that runs
Here we see the user already learned he needs to put the 'next' before, Now that won't even be good enough. Now he will need to double the size |
Then you made a weird command line and curl tells you about it.
I disagree. Before this change, curl accepted the syntax but the outcome was not clear or even understandable - you reported a bug that was a direct result of that internal confusion. By allowing wrong syntax and just silently trying to survive anyway, we make the behavior harder to understand and less deterministic.
That user does not use
I don't understand. Why can it only be written 999 times? |
I was talking about the GitHub title. Anyway, for a large batch job, in a config file, we make 1000 of these, (here's two):
That already caused an error.
and the error goes away! But today, you are proposing to also make that That means that there is no longer to make 1000 sets each with five Sure, of my 1000 sets, the very first or the very last next serves no It is like
Oh boy, there is a wasted comma! Error: not at all. |
Am I mistaken or this closed PR somehow found its way into master?
|
One argument for allowing the redundant placement of
|
Reported-by: 積丹尼 Dan Jacobson Ref: curl#10769 (comment) Closes curl#10782
I just want to mention a work-around I found, for anyone else who want to skip the first URL: just put My use-case for doing this is that I have a loop that constructs a curl command (adding one request per item in a list i iterate over). Instead of conditionally adding The end result looks like this: Works like a charm! 👍 |
Next thing you know cURL no longer allows |
Sarcasm all you like. We make our best. |
You are a true open source rock star, Daniel. Thank you (and the team) for your efforts with curl! ❤️ This was a breaking change in a major release, so absolutely no biggie as far as I'm concerned. And it was pretty easy for me to find this PR by checking the release notes, so I was able to identify the exact change that I was affected by. That is all great. But I find no details on the reason for this change. Is that anywhere to find? I think that sometimes people can feel frustrated when a change is introduced if they do not understand the reason for it. If the PR description or commits had a brief summary of why a change is introduced, maybe it would help people understand and reduce irritation. Unless it is too much effort for you, perhaps that could be an improvement for future releases. |
I have explained them earlier in this PR: Before this change, curl accepted the syntax but the outcome was not clear or even understandable. By allowing wrong syntax and just silently trying to survive anyway, we make the behavior harder to understand and less deterministic. I should have done a better job and explained that already in the PR description, which is my bad. |
No description provided.