Hacker News new | past | comments | ask | show | jobs | submit login

as it turns out (just had to look it up again, incidentally!) the correct form when piping it to an output tool is -s -S. E.g.:

    $ curl -s -S http://example.com/some.json | python -m json.tool
I want errors, but I don't want that annoying status bar to mess up the output. I don't use curl often enough to even remember I need two flags at all (e.g. I remember now, but didn't know when I wrote the original comment).

It can follow any philosophy it wants: when a user is consistently confused, I personally consider it bad UI.

EDIT: This is not the only bad / confusing default. Another popular one is -L. Not following redirects should be the exception; I almost never want curl to choke on 3xx. Result, I could practically alias curl="curl -L". Great software, but the UI is unfortunate.




Firstly, every CLI HTTP client I've used outputs a status to console, even when it detects standard out is being redirected / piped. It can be very annoying at times, but isn't a curl specific thing. And it's hardly a great ordeal to remember --silent (or quickly curl -h | grep silent / do a find inside man, should you need a memory jog). Perhaps a little tip here is to force yourself to use the longer flags as they're much more memorable?

Secondly, have you ever considered that there are just as many people who might not want curl to automatically follow redirects? Personally I happen to use curl a lot to check that redirects work (eg sending the right HTTP status code) so I'd find your preference more annoying than intuitive.

Lastly, I get that you might not like some of curls default behaviours, but given curl's command structure follows the same idioms as most POSIX / GNU command line programs do, it's a bit far reached to say curls UI is bad or "unfortunate". Particularly when where's other people that do prefer the default behaviour you dislike. And since curl does follow POSIX idioms, you can just create that alias you discussed to force curl into your preferred default behaviour (you don't get much more user friendly than a tool you can customise the default behaviour of).

This is why I say that curl follows the standard CLI UI pretty well - it doesn't throw much in the way of unexpected behaviour and anything specific that you may dislike can easily be tuned via the usual methods.


What situation were you running into that required "-s -S"? I'm able to pipe the output of curl to something else (or just consume it via IO redirection) just fine without either switch. The status bar is output on stderr.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: