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

Function newDiffCommand

cli/command/container/diff.go:15–29  ·  view source on GitHub ↗

newDiffCommand creates a new cobra.Command for `docker diff`

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

13
14// newDiffCommand creates a new cobra.Command for `docker diff`
15func newDiffCommand(dockerCLI command.Cli) *cobra.Command {
16 return &cobra.Command{
17 Use: "diff CONTAINER",
18 Short: "Inspect changes to files or directories on a container's filesystem",
19 Args: cli.ExactArgs(1),
20 RunE: func(cmd *cobra.Command, args []string) error {
21 return runDiff(cmd.Context(), dockerCLI, args[0])
22 },
23 Annotations: map[string]string{
24 "aliases": "docker container diff, docker diff",
25 },
26 ValidArgsFunction: completion.ContainerNames(dockerCLI, false),
27 DisableFlagsInUseLine: true,
28 }
29}
30
31func runDiff(ctx context.Context, dockerCLI command.Cli, containerID string) error {
32 res, err := dockerCLI.Client().ContainerDiff(ctx, containerID, client.ContainerDiffOptions{})

Callers 3

newContainerCommandFunction · 0.85
TestRunDiffFunction · 0.85
TestRunDiffClientErrorFunction · 0.85

Calls 1

runDiffFunction · 0.85

Tested by 2

TestRunDiffFunction · 0.68
TestRunDiffClientErrorFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…