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

Function newRemoveCommand

cli/command/service/remove.go:14–29  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

12)
13
14func newRemoveCommand(dockerCLI command.Cli) *cobra.Command {
15 cmd := &cobra.Command{
16 Use: "rm SERVICE [SERVICE...]",
17 Aliases: []string{"remove"},
18 Short: "Remove one or more services",
19 Args: cli.RequiresMinArgs(1),
20 RunE: func(cmd *cobra.Command, args []string) error {
21 return runRemove(cmd.Context(), dockerCLI, args)
22 },
23 ValidArgsFunction: completeServiceNames(dockerCLI),
24 DisableFlagsInUseLine: true,
25 }
26 cmd.Flags()
27
28 return cmd
29}
30
31func runRemove(ctx context.Context, dockerCLI command.Cli, serviceIDs []string) error {
32 apiClient := dockerCLI.Client()

Callers 1

newServiceCommandFunction · 0.70

Calls 2

completeServiceNamesFunction · 0.85
runRemoveFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…