basecommand: use logger.critical() instead of sys.stderr.write()

As a side effect, this fixes the missing trailing line break.
This commit is contained in:
Clément Bœsch
2017-09-08 20:55:55 +02:00
parent a7d70c6a56
commit 6938c506bb

View File

@@ -93,8 +93,8 @@ class BaseCommand():
self.parser.print_help()
sys.exit(0)
if not self.options.remainder[0] in self.subcommands:
sys.stderr.write("incorrect subcommand: %s" %
self.options.remainder[0])
logger.critical("incorrect subcommand: %s",
self.options.remainder[0])
sys.exit(1)
self.cmd = self.subcommands[self.options.remainder[0]](
self.options.remainder[1:],