mcui/input: Library Dependencies
These functions all have the same interface.
Upon return, a valid value will be stored in the named variable; if the value was not valid, the function raises an error.
parse_intParse a string as an integer
$1 - raw value to parse
$2 - variable name
parse_boolParse a string as a boolean
$1 - raw value to parse
$2 - variable name
parse_yesnoParse a string as a yes or no answer
$1 - raw value to parse
$2 - variable name
parse_yesnocancelParse a string as a yes, no, or cancel answer
$1 - raw value to parse
$2 - variable name
parse_onoffParse a string as an on or off answer
$1 - raw value to parse
$2 - variable name
read_stringInteractively reads a string into a variable
$1 - prompt
$2 - target variable
read_silentSame as read_string, but does not echo input.
read_and_parseReads a string and parses it into a typed variable
$1 - name of parser function
$2 - prompt
$3 - target variable
assert_parseAsserts variable ($2) is type ($1) or prints error ($3)
$1 - parsing type, used to derive parsing function (e.g. 'parse_int')
$2 - name of variable
$3 - error to display if assertion fails
assert_parse_listAsserts values ($...) are type ($1) or prints error ($2)
$1 - $ptype, $2 - $error, $3 - $var