()
| 26 | ` |
| 27 | |
| 28 | func NewRemoveBucketCommand() *cli.Command { |
| 29 | cmd := &cli.Command{ |
| 30 | Name: "rb", |
| 31 | HelpName: "rb", |
| 32 | Usage: "remove bucket", |
| 33 | CustomHelpTemplate: removeBucketHelpTemplate, |
| 34 | Before: func(c *cli.Context) error { |
| 35 | err := validateMBCommand(c) // uses same validation function with make bucket command. |
| 36 | if err != nil { |
| 37 | printError(commandFromContext(c), c.Command.Name, err) |
| 38 | } |
| 39 | return err |
| 40 | }, |
| 41 | Action: func(c *cli.Context) (err error) { |
| 42 | defer stat.Collect(c.Command.FullName(), &err)() |
| 43 | |
| 44 | return RemoveBucket{ |
| 45 | src: c.Args().First(), |
| 46 | op: c.Command.Name, |
| 47 | fullCommand: commandFromContext(c), |
| 48 | |
| 49 | storageOpts: NewStorageOpts(c), |
| 50 | }.Run(c.Context) |
| 51 | }, |
| 52 | } |
| 53 | |
| 54 | cmd.BashComplete = getBashCompleteFn(cmd, true, true) |
| 55 | return cmd |
| 56 | } |
| 57 | |
| 58 | // RemoveBucket holds bucket deletion operation flags and states. |
| 59 | type RemoveBucket struct { |
no test coverage detected