nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa32ec6
)
toolcontext: add `ToolContext::quit` to perform a correct shutdown of the program
author
Jean Privat
<jean@pryen.org>
Sat, 7 Nov 2015 04:08:24 +0000
(23:08 -0500)
committer
Jean Privat
<jean@pryen.org>
Sat, 7 Nov 2015 04:08:24 +0000
(23:08 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>
src/toolcontext.nit
patch
|
blob
|
history
diff --git
a/src/toolcontext.nit
b/src/toolcontext.nit
index
bdd6338
..
850781e
100644
(file)
--- a/
src/toolcontext.nit
+++ b/
src/toolcontext.nit
@@
-169,6
+169,16
@@
class ToolContext
return tags.has("all") or tags.has(tag)
end
+ # Output all current stacked messages, total and exit the program
+ #
+ # If there is no error, exit with 0, else exit with 1.
+ fun quit
+ do
+ check_errors
+ errors_info
+ if error_count > 0 then exit(1) else exit(0)
+ end
+
# Output all current stacked messages
#
# Return true if no errors occurred.