()
| 23 | ) |
| 24 | |
| 25 | func newConfigResetCmd() *cobra.Command { |
| 26 | cmd := &cobra.Command{ |
| 27 | Use: "reset", |
| 28 | Short: "Reset the CLI configuration", |
| 29 | Annotations: map[string]string{ |
| 30 | skipActionOptsInit: trueString, |
| 31 | }, |
| 32 | Run: func(cmd *cobra.Command, args []string) { |
| 33 | configFile := viper.ConfigFileUsed() |
| 34 | err := os.Remove(configFile) |
| 35 | cobra.CheckErr(err) |
| 36 | logger.Info().Str("file", configFile).Msg("Config file removed") |
| 37 | }, |
| 38 | } |
| 39 | |
| 40 | return cmd |
| 41 | } |