(dockerCLI command.Cli)
| 19 | } |
| 20 | |
| 21 | func 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 | |
| 41 | const ingressWarning = "WARNING! Before removing the routing-mesh network, " + |
| 42 | "make sure all the nodes in your swarm run the same docker engine version. " + |
searching dependent graphs…