townsfolk / gradle-templates

A gradle project templates plugin
Apache License 2.0
315 stars 99 forks source link

DefaultValue in promptOptions cause error #22

Closed polopi closed 9 years ago

polopi commented 9 years ago

See also #20 #21 The method request an int as defaultValue value

static int promptOptions(String message, int defaultValue, List options = [])

then in readLine, it returns the int

return System.console().readLine(_message) ?: defaultValue

and then tries to call parseInt on it

int choice = Integer.parseInt(readLine(consoleMessage, defaultValue))

Finally you end up with that kind of error : No signature of method: static java.lang.Integer.parseInt() is applicable for argument types: (java.lang.Integer) values: [0]