Pārlūkot izejas kodu

Show a sensible error when an unknown service name is given to 'run'

Aanand Prasad 12 gadi atpakaļ
vecāks
revīzija
e5642bd8b7
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      plum/cli/main.py

+ 2 - 0
plum/cli/main.py

@@ -87,6 +87,8 @@ class TopLevelCommand(Command):
         Usage: run SERVICE COMMAND [ARGS...]
         """
         service = self.service_collection.get(options['SERVICE'])
+        if service is None:
+            raise UserError("No such service: %s" % options['SERVICE'])
         container_options = {
             'command': [options['COMMAND']] + options['ARGS'],
         }