diff --git a/src/grisp_tools_configure.erl b/src/grisp_tools_configure.erl index dc447cc..dfe195f 100644 --- a/src/grisp_tools_configure.erl +++ b/src/grisp_tools_configure.erl @@ -9,12 +9,16 @@ % {Name, {Long, Short}, {Type, Default}, Description} -type settings() :: {string(), {string(), char()}, - {string, string()} | {boolean, boolean()}, + {string, string()} + | {boolean, boolean()} + | {latin1, string()}, string()}. -type settings_options() :: {string(), {string(), char()}, - {string, string()} | {boolean, boolean()}, + {string, string()} + | {boolean, boolean()} + | {latin1, string()}, string(), function()} | settings(). @@ -109,7 +113,7 @@ settings() -> -spec settings_options() -> [settings_options()]. settings_options() -> [ - {"App name", {name, undefined}, {string, "robot"}, + {"App name", {name, undefined}, {latin1, "robot"}, "The name of the OTP application"}, {"Erlang version", {otp_version, $o}, {string, "25"}, "The OTP version of the GRiSP app"}, diff --git a/src/grisp_tools_io.erl b/src/grisp_tools_io.erl index d8397be..247844e 100644 --- a/src/grisp_tools_io.erl +++ b/src/grisp_tools_io.erl @@ -70,12 +70,21 @@ get(integer, String) -> Integer -> Integer end; +get(latin1, []) -> + no_data; +get(latin1, Data) -> + case io_lib:latin1_char_list(Data) of + true -> + Data; + false -> + no_clue + end; get(string, []) -> no_data; get(string, String) -> case is_list(String) of true -> - String; + unicode:characters_to_binary(String); false -> no_clue end.