Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm glad that this package exists.

I know of UNIX parameters, with a single hyphen & a single letter, and GNU parameters, with a double parameter and a word. But a single hyphen and then a word: *mind broken*.

When I first saw that on Terraform, I was upset & conflicted.

OK, I know that Java also has mental parameter options like that ('-version', note the *single* hyphen followed by, gasp, a word!), but I just dismissed it as weird enterprise-ism.

Then I saw that this 'single hyphen + word' was an accepted convention for parameters, in the Go world & I was disappointed.

Glad that this package is fighting the good fight.



> OK, I know that Java also has mental parameter options like that ('-version', note the *single* hyphen followed by, gasp, a word!), but I just dismissed it as weird enterprise-ism.

I think "mental" is being too kind about java.

    $ java -version
and

    $ java --version
both work, their outputs are different, and `-version` goes to STDERR whereas `--version` goes to STDOUT.


I'm gonna take a stab here and say that -version behaves in a BSD manner and --version behaves in a GNU manner.


It's just that if you pass "ersion" to --verbose it prints the version :D


`find` is also notorious for its parameter style. But in my opinion programmers sometimes put too much importance on following conventions. You're not gonna go blind from looking at an incorrectly indented line. If the founding fathers of unix didn't want us creating horrifying monstrosities, they shouldn't have given us unlimited access to argv :)


Fun fact, `find`'s wonky argument syntax predates GNU syntax. It was part of Version 5 Unix from 1974. https://en.wikipedia.org/wiki/Find_(Unix)


I used find frequently for more than a decade and it just never felt natural to me. I get there in the end but have to stop and think.

With fd, a modern 'equivalent', I barely think just type.

Same for grep.


As was `dd`, another program with an unorthodox syntax.




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

Search: