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

Function newRemoveCommand

cli/command/network/remove.go:21–39  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

19}
20
21func newRemoveCommand(dockerCLI command.Cli) *cobra.Command {
22 var opts removeOptions
23
24 cmd := &cobra.Command{
25 Use: "rm NETWORK [NETWORK...]",
26 Aliases: []string{"remove"},
27 Short: "Remove one or more networks",
28 Args: cli.RequiresMinArgs(1),
29 RunE: func(cmd *cobra.Command, args []string) error {
30 return runRemove(cmd.Context(), dockerCLI, args, &opts)
31 },
32 ValidArgsFunction: completion.NetworkNames(dockerCLI),
33 DisableFlagsInUseLine: true,
34 }
35
36 flags := cmd.Flags()
37 flags.BoolVarP(&opts.force, "force", "f", false, "Do not error if the network does not exist")
38 return cmd
39}
40
41const ingressWarning = "WARNING! Before removing the routing-mesh network, " +
42 "make sure all the nodes in your swarm run the same docker engine version. " +

Callers 3

newNetworkCommandFunction · 0.70
TestNetworkRemoveForceFunction · 0.70

Calls 1

runRemoveFunction · 0.70

Tested by 2

TestNetworkRemoveForceFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…