()
| 39 | ` |
| 40 | |
| 41 | func 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 | } |
no test coverage detected