aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-07-22 19:26:15 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-07-22 19:26:15 +0100
commit09322b68fd943ec83e616145afd71ea4f080ea17 (patch)
tree0ee2369d6e6854ea935641574fd760691708f82b /Main.hs
parent68d683e6e2443c5e512ab2d7cc7c006a6bb372c5 (diff)
downloadnumberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.tar.gz
numberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.tar.bz2
numberdisplay-09322b68fd943ec83e616145afd71ea4f080ea17.zip
(General)~indentation
Makes it look a bit nicer.
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs9
1 files 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