Show usage errors in red

This commit is contained in:
Bruno Oliveira 2018-01-16 19:35:32 -02:00
parent dc79116de3
commit e3406e0818
1 changed files with 2 additions and 1 deletions

View File

@ -60,8 +60,9 @@ def main(args=None, plugins=None):
finally: finally:
config._ensure_unconfigure() config._ensure_unconfigure()
except UsageError as e: except UsageError as e:
tw = py.io.TerminalWriter(sys.stderr)
for msg in e.args: for msg in e.args:
sys.stderr.write("ERROR: %s\n" % (msg,)) tw.line("ERROR: {}\n".format(msg), red=True)
return 4 return 4