arg_type() =
boolean | float |
{float, Choice :: [float()]} |
{float, [{min, float()} | {max, float()}]} |
integer |
{integer, Choices :: [integer()]} |
{integer, [{min, integer()} | {max, integer()}]} |
string |
{string, Choices :: [string()]} |
{string, Re :: string()} |
{string, Re :: string(), ReOptions :: [term()]} |
binary |
{binary, Choices :: [binary()]} |
{binary, Re :: binary()} |
{binary, Re :: binary(), ReOptions :: [term()]} |
atom |
{atom, Choices :: [atom()]} |
{atom, unsafe} |
{custom, fun((string()) -> term())}
boolean | float |
{float, Choice :: [float()]} |
{float, [{min, float()} | {max, float()}]} |
integer |
{integer, Choices :: [integer()]} |
{integer, [{min, integer()} | {max, integer()}]} |
string |
{string, Choices :: [string()]} |
{string, Re :: string()} |
{string, Re :: string(), ReOptions :: [term()]} |
binary |
{binary, Choices :: [binary()]} |
{binary, Re :: binary()} |
{binary, Re :: binary(), ReOptions :: [term()]} |
atom |
{atom, Choices :: [atom()]} |
{atom, unsafe} |
{custom, fun((string()) -> term())}
Defines type conversion applied to the string retrieved from the user input. If the conversion is successful, resulting value is validated using optional Choices, or minimums and maximums (for integer and floating point values only). Strings and binary values may be validated using regular expressions. It's possible to define custom type conversion function, accepting a string and returning Erlang term. If this function raises error with badarg reason, argument is treated as invalid.