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

Function newListCommand

cli/command/checkpoint/list.go:18–37  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

16}
17
18func newListCommand(dockerCLI command.Cli) *cobra.Command {
19 var opts listOptions
20
21 cmd := &cobra.Command{
22 Use: "ls [OPTIONS] CONTAINER",
23 Aliases: []string{"list"},
24 Short: "List checkpoints for a container",
25 Args: cli.ExactArgs(1),
26 RunE: func(cmd *cobra.Command, args []string) error {
27 return runList(cmd.Context(), dockerCLI, args[0], opts)
28 },
29 ValidArgsFunction: completion.ContainerNames(dockerCLI, false),
30 DisableFlagsInUseLine: true,
31 }
32
33 flags := cmd.Flags()
34 flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory")
35
36 return cmd
37}
38
39func runList(ctx context.Context, dockerCLI command.Cli, container string, opts listOptions) error {
40 checkpoints, err := dockerCLI.Client().CheckpointList(ctx, container, client.CheckpointListOptions{

Callers 3

newCheckpointCommandFunction · 0.70
TestCheckpointListErrorsFunction · 0.70

Calls 1

runListFunction · 0.70

Tested by 2

TestCheckpointListErrorsFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…