Created
February 5, 2014 23:30
-
-
Save danidiaz/8835570 to your computer and use it in GitHub Desktop.
Example use of cmdargs.
This file contains hidden or 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.Console.CmdArgs.Explicit | |
| main :: IO () | |
| main = do | |
| let flags = [Flag ["l","lj"] FlagReq (\s -> Right . (s:)) "type" "fooo"] | |
| arguments :: Mode [String] | |
| arguments = mode "foobar" [] "helpy" (Arg (const Right) "ff" False) flags | |
| xs <- processArgs arguments | |
| print $ helpText [] HelpFormatDefault arguments | |
| mapM_ putStrLn xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment