Hacker News new | ask | show | jobs
by kibwen 3620 days ago
Go isn't immune to the problem either. See the `flag` package, which is something that new users are encouraged to avoid in favor of e.g. https://github.com/jessevdk/go-flags .
1 comments

I am a Go programmer and I've never seen anyone anywhere encouraging people to use anything over the flag package. How did you get such impression?
Docker, for example, say "seriously just don't use it".

http://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-...

Everybody I have ever seen do CLI applications in Go will recommend heavily against it.
The package you mentioned has about 200 imports. Compare that with the standard package. https://godoc.org/?q=Flag
If you want to write command line apps that conform to the GNU flags convention you can't use the "flag" library. I wrote my own simple getopt implementation (github.com/timtadh/getopt) years ago so I could just get some work done. It works fine and has no dependencies. I write a lot of complicated command line applications and having a small simple getopt implementation makes it a lot easier. Sometimes a higher level tool would be nice but I have never found one I actually like.
Why do minor variations in flag syntax matter so much you'd write your own? It seems easier to adjust to using the standard flag package.
The standard package cannot be changed.