(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions)
| 36 | } |
| 37 | |
| 38 | func topCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { |
| 39 | opts := topOptions{ |
| 40 | ProjectOptions: p, |
| 41 | } |
| 42 | topCmd := &cobra.Command{ |
| 43 | Use: "top [SERVICES...]", |
| 44 | Short: "Display the running processes", |
| 45 | RunE: Adapt(func(ctx context.Context, args []string) error { |
| 46 | return runTop(ctx, dockerCli, backendOptions, opts, args) |
| 47 | }), |
| 48 | ValidArgsFunction: completeServiceNames(dockerCli, p), |
| 49 | } |
| 50 | return topCmd |
| 51 | } |
| 52 | |
| 53 | type ( |
| 54 | topHeader map[string]int // maps a proc title to its output index |
no test coverage detected