23 Jan
2001
23 Jan
'01
7:27 p.m.
Shlomi Fish wrote:
How can I read the command-line arguments passed to the program. For instance, if I run my compiled program by typing "./foo hello -o file.txt", I wish to access the list ["hello", "-o", "file.txt"] somehow.
module Main (main) where import System
main = getArgs >>= \args -> hugsMain args hugsMain :: [String] -> IO () hugsMain = print
ghc Main.lhs a.out foo bar --help ["foo","bar","--help"] Sengan