diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-22 19:26:15 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-22 19:26:15 +0100 |
commit | 09322b68fd943ec83e616145afd71ea4f080ea17 (patch) | |
tree | 0ee2369d6e6854ea935641574fd760691708f82b | |
parent | 68d683e6e2443c5e512ab2d7cc7c006a6bb372c5 (diff) | |
download | numberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.tar.gz numberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.tar.bz2 numberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.zip |
(General)~indentation
Makes it look a bit nicer.
-rw-r--r-- | Main.hs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |