MCPcopy
hub / github.com/docker/compose / topCommand

Function topCommand

cmd/compose/top.go:38–51  ·  cmd/compose/top.go::topCommand
(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions)

Source from the content-addressed store, hash-verified

36}
37
38func 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
53type (
54 topHeader map[string]int // maps a proc title to its output index

Callers 1

RootCommandFunction · 0.85

Calls 3

AdaptFunction · 0.85
runTopFunction · 0.85
completeServiceNamesFunction · 0.85

Tested by

no test coverage detected