NewSync creates Sync from cli.Context
(c *cli.Context)
| 145 | |
| 146 | // NewSync creates Sync from cli.Context |
| 147 | func NewSync(c *cli.Context) Sync { |
| 148 | return Sync{ |
| 149 | src: c.Args().Get(0), |
| 150 | dst: c.Args().Get(1), |
| 151 | op: c.Command.Name, |
| 152 | fullCommand: commandFromContext(c), |
| 153 | |
| 154 | // flags |
| 155 | delete: c.Bool("delete"), |
| 156 | sizeOnly: c.Bool("size-only"), |
| 157 | exitOnError: c.Bool("exit-on-error"), |
| 158 | |
| 159 | // flags |
| 160 | followSymlinks: !c.Bool("no-follow-symlinks"), |
| 161 | storageClass: storage.StorageClass(c.String("storage-class")), |
| 162 | raw: c.Bool("raw"), |
| 163 | // region settings |
| 164 | srcRegion: c.String("source-region"), |
| 165 | dstRegion: c.String("destination-region"), |
| 166 | storageOpts: NewStorageOpts(c), |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | // Run compares files, plans necessary s5cmd commands to execute |
| 171 | // and executes them in order to sync source to destination. |
no test coverage detected