(c ...*cobra.Command)
| 27 | } |
| 28 | |
| 29 | func GetRootCmdWithSubCommands(c ...*cobra.Command) *cobra.Command { |
| 30 | prepareViperConfig() |
| 31 | |
| 32 | rootCmd := &cobra.Command{} |
| 33 | rootCmd.PersistentFlags().String("app", "", "app name") |
| 34 | rootCmd.AddCommand(c...) |
| 35 | rootCmd.SetIn(&bytes.Buffer{}) |
| 36 | rootCmd.SetOut(&bytes.Buffer{}) |
| 37 | rootCmd.SetErr(&bytes.Buffer{}) |
| 38 | |
| 39 | return rootCmd |
| 40 | } |
| 41 | |
| 42 | func InitClient() *stream.Client { |
| 43 | c, err := stream.NewClientFromEnvVars() |