()
| 22 | ) |
| 23 | |
| 24 | func newCASBackendDeleteCmd() *cobra.Command { |
| 25 | var name string |
| 26 | |
| 27 | cmd := &cobra.Command{ |
| 28 | Use: "delete", |
| 29 | Aliases: []string{"rm"}, |
| 30 | Short: "Delete a CAS Backend from your organization", |
| 31 | RunE: func(cmd *cobra.Command, args []string) error { |
| 32 | if confirmed, err := confirmDefaultCASBackendRemoval(ActionOpts, name); err != nil { |
| 33 | return err |
| 34 | } else if !confirmed { |
| 35 | log.Info("Aborting...") |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | if err := action.NewCASBackendDelete(ActionOpts).Run(name); err != nil { |
| 40 | return err |
| 41 | } |
| 42 | |
| 43 | logger.Info().Msg("Backend deleted") |
| 44 | |
| 45 | return nil |
| 46 | }, |
| 47 | } |
| 48 | |
| 49 | cmd.Flags().StringVar(&name, "name", "", "CAS Backend name") |
| 50 | cobra.CheckErr(cmd.MarkFlagRequired("name")) |
| 51 | return cmd |
| 52 | } |
no test coverage detected