From 01747af081a9887749340abbcc0d7587cde6254e Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Mon, 28 Nov 2022 01:20:58 +0900 Subject: [PATCH] rearrange template script --- dayN.exs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dayN.exs b/dayN.exs index ba7ecec..4d0c5d8 100644 --- a/dayN.exs +++ b/dayN.exs @@ -7,19 +7,23 @@ defmodule DayREPLACE_ME do :ok end - 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(), {:ok, input} <- File.read(input_filename) do input 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 @@ -52,4 +56,4 @@ defmodule DayREPLACE_ME do end end -DayREPLACE_ME.run() +# DayREPLACE_ME.run()