commit 0b2aa768ecb2db340be6d0eb95aad3e6d13b0396
parent 6f4351e335b19b7e3bf440f805f6bc0332bf7cda
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Fri, 27 Apr 2012 18:32:48 +0200
return value
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/plint.py b/plint.py
@@ -4,6 +4,7 @@ import sys
import template
def run():
+ ok = True
while True:
line = sys.stdin.readline()
if not line:
@@ -11,6 +12,8 @@ def run():
errors = template.check(line)
for error in errors:
print(error.report(), file=sys.stderr)
+ ok = False
+ return ok
if __name__ == '__main__':
if len(sys.argv) != 2:
@@ -24,5 +27,6 @@ if __name__ == '__main__':
f.close()
template = template.Template(x)
- run()
+ ok = run()
+ sys.exit(0 if ok else 1)