For the sake of accuracy, I probably should correct the above code snippet to something like:
def password(message) do print_app() IO.puts(message <> " ") List.to_string(:io.get_password()) end On Monday, 8 November 2021 at 18:51:25 UTC Darragh Enright wrote: > Hello folks 👋 > > I was making a tweak to Mix.Shell.IO.yes?/1 a while back and it occurred > to me that it would also nice to have a password function, much the same as > Mix.Shell.IO.prompt/1 except it would hide input from the user, which I > am sure is familiar functionality to almost every developer. > > I just had some time to look into how to implement this and it seems this > would be easy to implement by wrapping :io.get_password/1 — for example: > > def password(message) do > print_app() > :io.get_password(message <> " ") > end > > Of course, in saying that, would that be a counterargument for precluding > creating this functionality at all? :D > > Thanks! > Darragh > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/16a21fa4-0984-445a-be62-581bfce0f32cn%40googlegroups.com.