Juniper / contrail

Contrail repo for core components (go based)
Apache License 2.0
44 stars 32 forks source link

CLI #2

Closed damianoneill closed 6 years ago

damianoneill commented 6 years ago

"Cobra is a really clean package. I wish my own CLI library was as good!" - Jeremy Saenz (author of codegangsta/cli)

Kube, Openshift and most of our golang utilities have moved from urfave to cobra over the last 12 months. Worth checking it out.

https://github.com/spf13/cobra

nati commented 6 years ago

will move to this.

damianoneill commented 6 years ago

To save you some time, cobra includes a cmd line generator as part of the package that will generate the boilerplate for your cli. See here https://github.com/spf13/cobra/blob/master/cobra/README.md

damianoneill commented 6 years ago

If you are going to use Cobra, you should consider https://github.com/spf13/viper (sister project) for configuration. I assume we will want to do a fair bit of configuration via the environment? If so viper makes this very easy in go.

If you are going to look at Viper, see https://github.com/theherk/viper fork which includes the ability to write the configuration to a local file system, not just reading the configuration.

nati commented 6 years ago

Thank you for info. I'm already using viper for configuration.