rearrange template script
This commit is contained in:
parent
8cd6e34a29
commit
01747af081
1 changed files with 13 additions and 9 deletions
22
dayN.exs
22
dayN.exs
|
@ -7,19 +7,23 @@ defmodule DayREPLACE_ME do
|
||||||
:ok
|
:ok
|
||||||
end
|
end
|
||||||
|
|
||||||
def run do
|
|
||||||
case input() do
|
|
||||||
:usage -> print_usage()
|
|
||||||
input -> run_parts_with_timer(input)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def input do
|
def input do
|
||||||
with [input_filename] <- System.argv(),
|
with [input_filename] <- System.argv(),
|
||||||
{:ok, input} <- File.read(input_filename) do
|
{:ok, input} <- File.read(input_filename) do
|
||||||
input
|
input
|
||||||
else
|
else
|
||||||
_ -> :usage
|
_ -> :error
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# HERE BE BOILERPLATE #
|
||||||
|
#######################
|
||||||
|
|
||||||
|
def run do
|
||||||
|
case input() do
|
||||||
|
:error -> print_usage()
|
||||||
|
input -> run_parts_with_timer(input)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,4 +56,4 @@ defmodule DayREPLACE_ME do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
DayREPLACE_ME.run()
|
# DayREPLACE_ME.run()
|
||||||
|
|
Loading…
Reference in a new issue