Hello, I have an issue using Haskell's Command-Line args functionality. I'm writing a Typechecker for my parser and I need to be able to tell my program via command-line arguments that I can have at most x errors reported where x is:
./typechecker --number-of-errors=x test.cl
This is the run-statement I use after I have compiled my Haskell program using:
I handle this in Main.hs, you can find the relevant code here:
main :: IO () main = do filenames <- getArgs -- get the command line arguments when (null filenames) (fail "No file name") mapM_ (\f -> processFile f `catch` (const (return ()))) filenames
I am confused on how to implement capturing the "--" flag and on top of this, how to capture whatever value x will be. I'm not asking you to complete this for me, I'm just looking for resources to use to help me out. I can't seem to locate the proper modules to include that provide functions for doing this. Any guidance is appreciated!