From 09322b68fd943ec83e616145afd71ea4f080ea17 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 22 Jul 2021 19:26:15 +0100 Subject: (General)~indentation Makes it look a bit nicer. --- Main.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Main.hs b/Main.hs index 9c6ab3f..cfe5669 100644 --- a/Main.hs +++ b/Main.hs @@ -5,8 +5,10 @@ import Text.Printf errorMessage :: String -> String -errorMessage "" = "nd v1\nUsage: nd [-int, -prime, -factor, -hcf]" -errorMessage reason = "nd v1\nFAILURE: " ++ reason ++ "\nUsage: nd [-int, -prime, -factor, -hcf]" +errorMessage "" = "nd v1\nUsage: nd [-help, -int, -prime, -factor, -hcf]\n" +errorMessage reason = "nd v1\nFAILURE: " + ++ reason + ++ "\nUsage: nd [-int, -prime, -factor, -hcf]\n" flagHandlerF :: [String] -> Int -> String -> ([String] -> String) -> String @@ -55,8 +57,9 @@ flagHandler "-hcf" args = hcf = head $ reverse $ intersect (factors n) (factors m) in "hcf(" ++ show n ++ ", " ++ show m ++ "): hcf=" ++ show hcf) +flagHandler _ _ = + errorMessage "Flag not recognised" -flagHandler _ _ = errorMessage "Didn't recognise flag" main = do args <- getArgs -- cgit v1.2.3-13-gbd6f