Created
July 15, 2015 15:03
-
-
Save taisyo7333/3915bdae28ce65a1424e to your computer and use it in GitHub Desktop.
Haskell : Arguments and program name are ... .
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Environment | |
import Data.List | |
{- | |
>.\arg.exe abc xyz "123 456" | |
The arguments are: | |
abc | |
xyz | |
123 456 | |
The program name is: | |
arg.exe | |
-} | |
main = do | |
args <- getArgs | |
progName <- getProgName | |
putStrLn "The arguments are:" | |
mapM_ putStrLn args | |
putStrLn "The program name is:" | |
putStrLn progName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment