- https://cs.github.com/?scopeName=All+repos&scope=&q=github.c...
The Cobra library is a huge one: https://github.com/spf13/cobra
Other stuff worth a look includes:
Tmux: https://github.com/tmux/tmux Kitty: https://github.com/kovidgoyal/kitty Alacritty: https://github.com/alacritty/alacritty
I'm sure there's lots of other stuff I don't know about as well.
Not sure about the relevant point on compact short options syntax as in `tar -xvzf archive.tgz` though... (edit) after a quick & sloppy test it seems to work as expected
i.e. Docker / K8s / OpenFaaS and similar
Or they just use viper [3] for both command line and general configuration handling. No point reinventing the wheel or trying to remember some weird non-standard quirks.
[1] https://github.com/spf13/pflag
It's reasonably fast, compiles down to a simple to distribute binary, and the language is forgiving enough that you can do exploratory programming in it. Go-routines make it especially easy to deal with network calls in it as well. For anything that needs absolute performance though look elsewhere, but even then Go might be a good choice for prototyping.
I actually started learning Go with CLI applications. I have found that https://github.com/spf13/cobra tends to be one of the better CLI helpers you can get into but https://github.com/jpillora/opts is one I have been meaning to try following a presentation I saw on it once.
Large projects like Hugo and Kubernetes have used Cobra to build their CLI tools, and it's fairly light as well even if you need simpler usage. We use it at my workplace simply for wrapping our microservices and the few commands (serve, migrate, etc)
For CLIs - https://github.com/spf13/cobra.
However, will definitely try out Docli whenever I start building something new :)
Tho admittedly it works in reverse; it generates the doc/help info rather than parsing it into an AST. It addresses the “boilerplate” issue with code gen as well, but it has a CLI to generate code that’s pretty powerful.
For instance, how does docli handle subcommands? How about global vs command specific flags? For any case beyond the basic single command CLI, it seems like there would need to be all sorts of magic and non-obvious formatting requirements on the doc string.
I just added bash completion to a few internal tools that work with kafka, basically just autocompleting topics. It was a little harder than I would have liked (who wants to write all that bash), and I had to fix a bug in Cobra, but overall it wasn't that bad.
I'm actually at Gophercon right now, if anyone wants to hack on Cobra at the community day on Thursday to make this easier, shoot me an email (@gmail).
I've also heard good things about https://github.com/spf13/cobra and https://github.com/codegangsta/cli.