diff --git a/compose/cli/main.py b/compose/cli/main.py index cfe29cd07..858f19479 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -238,8 +238,8 @@ class TopLevelCommand(Command): Usage: rm [options] [SERVICE...] Options: - --force Don't ask to confirm removal - -v Remove volumes associated with containers + -f, --force Don't ask to confirm removal + -v Remove volumes associated with containers """ all_containers = project.containers(service_names=options['SERVICE'], stopped=True) stopped_containers = [c for c in all_containers if not c.is_running] diff --git a/tests/integration/cli_test.py b/tests/integration/cli_test.py index cf9398379..32c4294cc 100644 --- a/tests/integration/cli_test.py +++ b/tests/integration/cli_test.py @@ -295,6 +295,12 @@ class CLITestCase(DockerClientTestCase): self.assertEqual(len(service.containers(stopped=True)), 1) self.command.dispatch(['rm', '--force'], None) self.assertEqual(len(service.containers(stopped=True)), 0) + service = self.project.get_service('simple') + service.create_container() + service.kill() + self.assertEqual(len(service.containers(stopped=True)), 1) + self.command.dispatch(['rm', '-f'], None) + self.assertEqual(len(service.containers(stopped=True)), 0) def test_kill(self): self.command.dispatch(['up', '-d'], None)