Implement congratulation display
This commit is contained in:
@@ -53,6 +53,12 @@ defmodule Display do
|
|||||||
format_error(error) |> IO.puts
|
format_error(error) |> IO.puts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def congratulate do
|
||||||
|
format_green("\nYou have learned much. You must find your own path now.")
|
||||||
|
|> IO.puts
|
||||||
|
exit(:normal)
|
||||||
|
end
|
||||||
|
|
||||||
def clear_screen do
|
def clear_screen do
|
||||||
if Options.clear_screen? do
|
if Options.clear_screen? do
|
||||||
IO.puts(ANSI.clear)
|
IO.puts(ANSI.clear)
|
||||||
@@ -97,6 +103,10 @@ defmodule Display do
|
|||||||
Enum.join([ANSI.cyan, str, ANSI.reset], "")
|
Enum.join([ANSI.cyan, str, ANSI.reset], "")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp format_green(str) do
|
||||||
|
Enum.join([ANSI.green, str, ANSI.reset], "")
|
||||||
|
end
|
||||||
|
|
||||||
defp format_module(module) do
|
defp format_module(module) do
|
||||||
Module.split(module) |> List.last
|
Module.split(module) |> List.last
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user