Hacker News new | ask | show | jobs
by ilovecaching 2653 days ago
I still feel that cobra and docopt are ungoish despite the author of cobra getting hired on. There's simply too much magic to both of them. I would much rather they improve flags, which is what I use. It really doesn't take that much with flags to add subcommands, etc, but it could be made better.
2 comments

Can you elaborate on what makes cobra ungoish? I had built a CLI using it without prior knowledge of Go (but with a background in scripting languages and a some C#) and it seemed pretty straightforward.

The only issue that I can tell was that you can possibly create errors that the compiler can miss, but it's been pretty solid otherwise.

Cobra is very much a kitchen sink approach with a lot of gen. I'd rather have less dependency and write just using the stdlib without the kitchen sink, which is more goish.
That makes a lot of sense.

I guess the parallel for me would be using Rack as opposed to Rails for Ruby.

Thanks for responding!

I use github.com/urfave/cli, but I almost always end up wrapping it with my own declarative framework. Gradually said framework is becoming more general purpose and suitable for general use, at which point I'll probably open source it and hopefully it will make someone's life better.