mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Show a sensible error when an unknown service name is given to 'run'
This commit is contained in:
parent
4cc906fcd2
commit
e5642bd8b7
@ -87,6 +87,8 @@ class TopLevelCommand(Command):
|
|||||||
Usage: run SERVICE COMMAND [ARGS...]
|
Usage: run SERVICE COMMAND [ARGS...]
|
||||||
"""
|
"""
|
||||||
service = self.service_collection.get(options['SERVICE'])
|
service = self.service_collection.get(options['SERVICE'])
|
||||||
|
if service is None:
|
||||||
|
raise UserError("No such service: %s" % options['SERVICE'])
|
||||||
container_options = {
|
container_options = {
|
||||||
'command': [options['COMMAND']] + options['ARGS'],
|
'command': [options['COMMAND']] + options['ARGS'],
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user