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

Function newListCommand

cli/command/stack/list.go:20–38  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

18}
19
20func newListCommand(dockerCLI command.Cli) *cobra.Command {
21 opts := listOptions{}
22
23 cmd := &cobra.Command{
24 Use: "ls [OPTIONS]",
25 Aliases: []string{"list"},
26 Short: "List stacks",
27 Args: cli.NoArgs,
28 RunE: func(cmd *cobra.Command, args []string) error {
29 return runList(cmd.Context(), dockerCLI, opts)
30 },
31 ValidArgsFunction: cobra.NoFileCompletions,
32 DisableFlagsInUseLine: true,
33 }
34
35 flags := cmd.Flags()
36 flags.StringVar(&opts.format, "format", "", flagsHelper.FormatHelp)
37 return cmd
38}
39
40// runList performs a stack list against the specified swarm cluster
41func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error {

Callers 3

newStackCommandFunction · 0.70
TestListErrorsFunction · 0.70
TestStackListFunction · 0.70

Calls 1

runListFunction · 0.70

Tested by 2

TestListErrorsFunction · 0.56
TestStackListFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…