MCPcopy Index your code
hub / github.com/docker/cli / copySummary

Function copySummary

cli/command/container/cp.go:204–213  ·  view source on GitHub ↗

copySummary formats the "Successfully copied ..." message. When contentSize differs from transferredSize, both values are shown.

(contentSize, transferredSize int64, dest string)

Source from the content-addressed store, hash-verified

202// copySummary formats the "Successfully copied ..." message.
203// When contentSize differs from transferredSize, both values are shown.
204func copySummary(contentSize, transferredSize int64, dest string) string {
205 if contentSize != transferredSize {
206 return fmt.Sprintf("Successfully copied %s (transferred %s) to %s\n",
207 progressHumanSize(contentSize), progressHumanSize(transferredSize), dest,
208 )
209 }
210 return fmt.Sprintf("Successfully copied %s to %s\n",
211 progressHumanSize(contentSize), dest,
212 )
213}
214
215func runCopy(ctx context.Context, dockerCli command.Cli, opts copyOptions) error {
216 srcContainer, srcPath := splitCpArg(opts.source)

Callers 3

copyFromContainerFunction · 0.85
copyToContainerFunction · 0.85
TestCopySummaryFunction · 0.85

Calls 1

progressHumanSizeFunction · 0.85

Tested by 1

TestCopySummaryFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…