Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
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
+Errors: 1
+Expected an integer for option -i, --int.
OptionBool: false
OptionCount: 0
OptionString:
OptionBool: false
OptionCount: 0
OptionString: