[Haskell-cafe] Program Command Line Arguments
Donald Bruce Stewart
dons at cse.unsw.edu.au
Sat Mar 10 20:51:16 EST 2007
> My apologies if this is a question with a trivial answer.
> Command line args in C are accessed via argc and argv
> defined as arguments to main();.
> How are command line arguments to a ghc-compiled program
> accessed in Haskell? Or is that even possible?
main = do
args <- getArgs
Example here: http://cgi.cse.unsw.edu.au/~dons/blog/2006/12/18#ph-3
You can find these functions yourself with hoogle:
Searching for 'args' returns:
System. getArgs :: IO [String]
P.S. This question is best asked on #haskell possibly (http://haskell.org/haskellwiki/IRC_channel)
More information about the Haskell-Cafe