MCPcopy
hub / github.com/peak/s5cmd / NewSyncCommand

Function NewSyncCommand

command/sync.go:93–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91}
92
93func 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
119type ObjectPair struct {
120 src, dst *storage.Object

Callers 1

CommandsFunction · 0.85

Calls 8

CollectFunction · 0.92
NewSyncCommandFlagsFunction · 0.85
validateCopyCommandFunction · 0.85
printErrorFunction · 0.85
commandFromContextFunction · 0.85
NewSyncFunction · 0.85
getBashCompleteFnFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected