News for hackers. Stuff that matters.
Re:A new curl option was born: --url-query by jrochkind1 on Thursday November 10, 2022 @08:36AM (#33546169)
> This is curl’s 249th command line option
Re:A new curl option was born: --url-query by ainar-g on Thursday November 10, 2022 @08:49AM (#33546321)
Almost quarter of a thousand. Yay!

That does raise an interesting question though. If one wanted to create a command-line tool (or, rather, toolset) as comprehensive as curl, but with a much smaller API surface, how would they go about it? Sure, some of these flags are just shorthands, and some of them could be removed entirely (-o → stdout redirection), but that still leaves a lot of options.

Re:A new curl option was born: --url-query by tyingq on Thursday November 10, 2022 @09:23AM (#33546843)
Curl supports a lot of crazy stuff that adds command line options, like IMAP/LDAP/POP3/SMTP means adding --login-options, --mail-auth, --mail-from, --mail-rcpt-allowfails, --mail-rcpt. If you read the man page, you'll find other flags that aren't really central to a http(s) fetch tool, like ftp, tftp.
Re:A new curl option was born: --url-query by pjc50 on Thursday November 10, 2022 @09:08AM (#33546623)
How would you keep it there? You'd have to spend a lot of effort discouraging feature requests.
Re:A new curl option was born: --url-query by danuker on Thursday November 10, 2022 @09:22AM (#33546821)
You don't need to discourage them. Just ignore them.

Perhaaps take a look at the most popular ones every now and then, but a free software project owes the world nothing.

Re:A new curl option was born: --url-query by thih9 on Thursday November 10, 2022 @11:40AM (#33549127)
In theory yes.

In practice I assume (I have no practical experience) that as the project gets larger the number of involved parties grows. And suddenly you need to balance interests of not just you but also the community, contributors, large users, sponsors and possibly more.

Re:A new curl option was born: --url-query by mmh0000 on Thursday November 10, 2022 @10:45AM (#33548107)
Ah. But -o is useful.

What if I’m running curl directly without a shell (e.g. in a container). How else would I save the output to a file?

Re:A new curl option was born: --url-query by thih9 on Thursday November 10, 2022 @11:47AM (#33549251)
wget ;)
Re:A new curl option was born: --url-query by bombcar on Thursday November 10, 2022 @05:49PM (#33554737)
On some systems without wget I have to alias wget to curl -o or whatever it is.
Re:A new curl option was born: --url-query by jrochkind1 on Thursday November 10, 2022 @11:00AM (#33548361)
Curl is really really big on backwards compatibility, which I don't mean to critisize.

If you were starting over from scratch even trying to make it curl-like, you could probably trim down the options substantially.

The OP is in fact an example of a new option that can more-or-less cover the same functionality as some old options, plus more, but the old options remain.

Re:A new curl option was born: --url-query by UI_at_80x24 on Thursday November 10, 2022 @08:59AM (#33546482)
Wow. Every time I've tried to dig into the man pages to find an option that I need it's been overwhelming; and now I know why!

This is one seriously under appreciated piece of code, and I am so grateful that it exists.

Re:A new curl option was born: --url-query by bpoyner on Thursday November 10, 2022 @09:13AM (#33546690)
They changed the curl man page in the last year so that all options have 'see also' recommendations. The documentation is amazing.

https://twitter.com/bagder/status/1460867775690387457

Re:A new curl option was born: --url-query by pablobaz on Thursday November 10, 2022 @09:13AM (#33546689)
I wonder will they have a party when they hit 250?
Re:A new curl option was born: --url-query by danuker on Thursday November 10, 2022 @09:20AM (#33546789)
I would do it at 256
Re:A new curl option was born: --url-query by nickcw on Thursday November 10, 2022 @09:18AM (#33546770)
This made me smile!

And also

    $ rclone help flags . | grep "^ *--"  | wc -l
    665
(yes rclone has a command to grep its flags `rclone help flags <regex>`!)
Re:A new curl option was born: --url-query by ape4 on Thursday November 10, 2022 @09:53AM (#33547308)
The article says the new option replaces the -G option. But, of course, for compatibility they cannot remove -G.