Yeah, but it also does not freezes when there is nothing on stdin, right? I do not see any equivalent in Elixir documentation (maybe I have missed something). I though about doing it in with Task timeout, but then I was not sure what timeout should I use (assuming that you don’t know how much data is in stdin), so everything goes to point where I would like to check
last_arg = List.last(args)
all_args = case do
option_type(last_arg) != :string -> args
is_stdin_empty() -> raise "Missing #{last_arg} option value!"
true -> args ++ [read_stdin()]
end
defp option_type("--test"), do: :string
defp option_type(_option), do: :value






















