MCPcopy Index your code
hub / github.com/peak/s5cmd / NewRemoveBucketCommand

Function NewRemoveBucketCommand

command/rb.go:28–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26`
27
28func 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.
59type RemoveBucket struct {

Callers 1

CommandsFunction · 0.85

Calls 7

CollectFunction · 0.92
validateMBCommandFunction · 0.85
printErrorFunction · 0.85
commandFromContextFunction · 0.85
NewStorageOptsFunction · 0.85
getBashCompleteFnFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected