Display better error message on unknown command, and return code 1

This commit is contained in:
Christophe CHAUVET
2013-08-27 19:31:41 +02:00
parent 76408ceca1
commit cdffe7e602

View File

@@ -257,7 +257,11 @@ class App(object):
return 0
def run_subcommand(self, argv):
subcommand = self.command_manager.find_command(argv)
try:
subcommand = self.command_manager.find_command(argv)
except ValueError as err:
LOG.error(err)
return 1
cmd_factory, cmd_name, sub_argv = subcommand
cmd = cmd_factory(self, self.options)
err = None