Command-line arguments: Difference between revisions

Content added Content deleted
No edit summary
m (→‎[[Haskell]]: formatting; fix "the the")
Line 96:
[[Category:Haskell]]
 
Defined theby the System module, getArgs :: IO [String] provides the command-line arguments in a list.
 
myprog.hs:
import System
main = getArgs >>= print
 
myprog a -h b c
=> ["a","-h","b","c"]
 
==[[Java]]==