Update template for easier input debugging

This commit is contained in:
Adam Millerchip 2022-11-28 00:28:42 +09:00
parent 92334ee1a6
commit 8cd6e34a29
1 changed files with 11 additions and 4 deletions

View File

@ -3,16 +3,23 @@ defmodule DayREPLACE_ME do
input input
end end
def part2(input) do def part2(_input) do
input :ok
end end
def run do def run do
case input() do
:usage -> print_usage()
input -> run_parts_with_timer(input)
end
end
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
run_parts_with_timer(input) input
else else
_ -> print_usage() _ -> :usage
end end
end end