|
@@ -983,7 +983,8 @@ func (cli *DockerCli) CmdRm(args ...string) error {
|
|
|
cmd := cli.Subcmd("rm", "[OPTIONS] CONTAINER [CONTAINER...]", "Remove one or more containers")
|
|
|
v := cmd.Bool([]string{"v", "-volumes"}, false, "Remove the volumes associated with the container")
|
|
|
link := cmd.Bool([]string{"l", "#link", "-link"}, false, "Remove the specified link and not the underlying container")
|
|
|
- force := cmd.Bool([]string{"f", "-force"}, false, "Force removal of running container")
|
|
|
+ stop := cmd.Bool([]string{"#f", "s", "#-force", "-stop"}, false, "Stop and remove a running container")
|
|
|
+ kill := cmd.Bool([]string{"k", "-kill"}, false, "Kill and remove a running container")
|
|
|
|
|
|
if err := cmd.Parse(args); err != nil {
|
|
|
return nil
|
|
@@ -992,6 +993,9 @@ func (cli *DockerCli) CmdRm(args ...string) error {
|
|
|
cmd.Usage()
|
|
|
return nil
|
|
|
}
|
|
|
+ if *stop && *kill {
|
|
|
+ return fmt.Errorf("Conflicting options: -s/--stop and -k/--kill")
|
|
|
+ }
|
|
|
val := url.Values{}
|
|
|
if *v {
|
|
|
val.Set("v", "1")
|
|
@@ -999,8 +1003,11 @@ func (cli *DockerCli) CmdRm(args ...string) error {
|
|
|
if *link {
|
|
|
val.Set("link", "1")
|
|
|
}
|
|
|
- if *force {
|
|
|
- val.Set("force", "1")
|
|
|
+ if *stop {
|
|
|
+ val.Set("stop", "1")
|
|
|
+ }
|
|
|
+ if *kill {
|
|
|
+ val.Set("kill", "1")
|
|
|
}
|
|
|
|
|
|
var encounteredError error
|