()
| 91 | } |
| 92 | |
| 93 | func NewSyncCommand() *cli.Command { |
| 94 | cmd := &cli.Command{ |
| 95 | Name: "sync", |
| 96 | HelpName: "sync", |
| 97 | Usage: "sync objects", |
| 98 | Flags: NewSyncCommandFlags(), |
| 99 | CustomHelpTemplate: syncHelpTemplate, |
| 100 | Before: func(c *cli.Context) error { |
| 101 | // sync command share same validation method as copy command |
| 102 | err := validateCopyCommand(c) |
| 103 | if err != nil { |
| 104 | printError(commandFromContext(c), c.Command.Name, err) |
| 105 | } |
| 106 | return err |
| 107 | }, |
| 108 | Action: func(c *cli.Context) (err error) { |
| 109 | defer stat.Collect(c.Command.FullName(), &err)() |
| 110 | |
| 111 | return NewSync(c).Run(c) |
| 112 | }, |
| 113 | } |
| 114 | |
| 115 | cmd.BashComplete = getBashCompleteFn(cmd, false, false) |
| 116 | return cmd |
| 117 | } |
| 118 | |
| 119 | type ObjectPair struct { |
| 120 | src, dst *storage.Object |
no test coverage detected