mirror of
https://github.com/docker/compose.git
synced 2025-07-26 15:14:04 +02:00
Add --force option to fig rm
This commit is contained in:
parent
96a92a73f1
commit
2ca0e7954a
@ -170,9 +170,10 @@ class TopLevelCommand(Command):
|
|||||||
"""
|
"""
|
||||||
Remove stopped service containers.
|
Remove stopped service containers.
|
||||||
|
|
||||||
Usage: rm [SERVICE...]
|
Usage: rm [options] [SERVICE...]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
--force Don't ask to confirm removal
|
||||||
-v Remove volumes associated with containers
|
-v Remove volumes associated with containers
|
||||||
"""
|
"""
|
||||||
all_containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
|
all_containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
|
||||||
@ -180,7 +181,8 @@ class TopLevelCommand(Command):
|
|||||||
|
|
||||||
if len(stopped_containers) > 0:
|
if len(stopped_containers) > 0:
|
||||||
print("Going to remove", list_containers(stopped_containers))
|
print("Going to remove", list_containers(stopped_containers))
|
||||||
if yesno("Are you sure? [yN] ", default=False):
|
if options.get('--force') \
|
||||||
|
or yesno("Are you sure? [yN] ", default=False):
|
||||||
self.project.remove_stopped(service_names=options['SERVICE'],
|
self.project.remove_stopped(service_names=options['SERVICE'],
|
||||||
remove_volumes=options.get('-v', False))
|
remove_volumes=options.get('-v', False))
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user