It would be nice to automatically generate config structure for any command e.g.
var RootCmd = &cobra.Command{
Use: "foobar",
...
func init() {
//
// You need to define flags as usual.
//
RootCmd.PersistentFlags().String("foo", "", "Some foonees must be set")
RootCmd.PersistentFlags().String("foo-bar", "", "Some barness must be set")
...
So kind of self-updating code. The tricky part is to how to start this process. This could be done simply by having a dummy struct in the beginning to make sure code compiles.
It would be nice to automatically generate config structure for any command e.g.
So kind of self-updating code. The tricky part is to how to start this process. This could be done simply by having a dummy struct in the beginning to make sure code compiles.