(dockerCLI command.Cli)
| 18 | } |
| 19 | |
| 20 | func 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 |
| 41 | func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error { |
searching dependent graphs…