aboutsummaryrefslogtreecommitdiff
path: root/lib/cli/cli.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cli/cli.ex')
-rw-r--r--lib/cli/cli.ex11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/cli/cli.ex b/lib/cli/cli.ex
index 8928040..2fbf8c2 100644
--- a/lib/cli/cli.ex
+++ b/lib/cli/cli.ex
@@ -64,15 +64,10 @@ defmodule SCLI do
end
defp handle_command(pid, ["hist"]) do
- case GenServer.call(pid, {:read_history, nil, 100}) do
- {:ok, list, _rest} ->
- list
- |> Enum.reverse
- |> Enum.each(fn {ts, nick, msg} ->
- IO.puts "#{ts |> DateTime.from_unix! |> DateTime.to_iso8601} <#{nick}> #{msg}"
+ GenServer.call(pid, {:read_history, nil, 25})
+ |> Enum.each(fn {{ts, nick, msg}, true} ->
+ IO.puts "#{ts |> DateTime.from_unix! |> DateTime.to_iso8601} <#{nick}> #{msg}"
end)
- _ -> nil
- end
pid
end