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

Function NewSync

command/sync.go:147–168  ·  view source on GitHub ↗

NewSync creates Sync from cli.Context

(c *cli.Context)

Source from the content-addressed store, hash-verified

145
146// NewSync creates Sync from cli.Context
147func 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.

Callers 1

NewSyncCommandFunction · 0.85

Calls 5

StorageClassTypeAlias · 0.92
commandFromContextFunction · 0.85
NewStorageOptsFunction · 0.85
GetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected