Enhanced the entry-point a bit

This commit is contained in:
Xavier Morel
2019-12-02 11:35:25 +01:00
parent f8ab279690
commit a57be274e3
2 changed files with 22 additions and 5 deletions

20
y2019/src/DayPicker.hs Normal file
View File

@@ -0,0 +1,20 @@
module DayPicker
( dayPicker
)
where
import System.Environment
import Day1
import Day2
load :: [String] -> IO ()
load [] = putStrLn "Usage: script [day]"
load ("1":_) = day1
load ("2":_) = day2
load _ = putStrLn "Unavailable date"
dayPicker :: IO ()
dayPicker = do
args <- getArgs
load args