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

Function NewMoveCommand

command/mv.go:41–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39`
40
41func NewMoveCommand() *cli.Command {
42 cmd := &cli.Command{
43 Name: "mv",
44 HelpName: "mv",
45 Usage: "move/rename objects",
46 Flags: NewCopyCommandFlags(), // move and copy commands share the same flags
47 CustomHelpTemplate: moveHelpTemplate,
48 Before: func(c *cli.Context) error {
49 return NewCopyCommand().Before(c)
50 },
51 Action: func(c *cli.Context) (err error) {
52 defer stat.Collect(c.Command.FullName(), &err)()
53
54 // delete source
55 copy, err := NewCopy(c, true)
56 if err != nil {
57 return err
58 }
59 return copy.Run(c.Context)
60 },
61 }
62
63 cmd.BashComplete = getBashCompleteFn(cmd, false, false)
64 return cmd
65}

Callers 1

CommandsFunction · 0.85

Calls 6

RunMethod · 0.95
CollectFunction · 0.92
NewCopyCommandFlagsFunction · 0.85
NewCopyCommandFunction · 0.85
NewCopyFunction · 0.85
getBashCompleteFnFunction · 0.85

Tested by

no test coverage detected