nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nitunit: the working dir is now `nitunit.out`
[nit.git]
/
lib
/
opts.nit
diff --git
a/lib/opts.nit
b/lib/opts.nit
index
da78780
..
30ea286
100644
(file)
--- a/
lib/opts.nit
+++ b/
lib/opts.nit
@@
-236,7
+236,13
@@
class OptionInt
super(help, default, names)
end
super(help, default, names)
end
- redef fun convert(str) do return str.to_i
+ redef fun convert(str)
+ do
+ if str.is_int then return str.to_i
+
+ errors.add "Expected an integer for option {names.join(", ")}."
+ return 0
+ end
end
# An option with a Float as parameter
end
# An option with a Float as parameter