diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-22 19:26:34 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2021-07-22 19:26:34 +0100 |
commit | 31cad52b14220a536b42b99f5c5a882c2ba27697 (patch) | |
tree | 39eadc2e117901efce295e954df26ddefaf4eebd | |
parent | 09322b68fd943ec83e616145afd71ea4f080ea17 (diff) | |
download | numberdisplay-31cad52b14220a536b42b99f5c5a882c2ba27697.tar.gz numberdisplay-31cad52b14220a536b42b99f5c5a882c2ba27697.tar.bz2 numberdisplay-31cad52b14220a536b42b99f5c5a882c2ba27697.zip |
(Main)~restructured main to be a bit smarter
Decompose args list via case so some arguments can be handled ahead of time.
-rw-r--r-- | Main.hs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -63,7 +63,7 @@ flagHandler _ _ = main = do args <- getArgs - if (length args) == 0 - then putStrLn $ errorMessage "" - else - putStrLn $ flagHandler (head args) (tail args) + putStr $ + case args of + [] -> errorMessage "" + (x: xs) -> if x == "-help" then errorMessage "" else flagHandler x xs |