top | item 43453431

(no title)

acmj | 11 months ago

When I use a command-line tool, I don't know and don't care if it is written in Go or not. I just want to use it the same way as most of the other traditional Unix tools. The Go style gets in the way. We would have much more consistent CLI between tools if Go had just followed the GNU style at the beginning. The same can be said to many other languages like Nim that want to reinvent command-line argument parsing with their standard libraries. https://xkcd.com/927/ came to mind.

discuss

order

klodolph|11 months ago

Can’t you just use --long options everywhere?

For, like, 95% of the tools out there, I’m going to use --long every single time.

Anyway, I don’t even know the options that a program takes until I read the program docs. The program docs will tell me that the option is -host=localhost or --host=localhost or --bind-addr=localhost:8000.

The other 5% are tools like ls, cp, mv. As far as I care, ancient tools are the only ones permitted to have short options that combine into a single option, like old-school getopt. Maybe a few exceptions now and then.

cratermoon|11 months ago

I use short options when I'm typing at the command line, but for scripts I prefer the long options by a wide margin. It's just too painful to come back to script after some time and see a string of short options that looks like line noise barfed out of a 300 baud modem.