Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Created February 5, 2014 23:30
Show Gist options
  • Select an option

  • Save danidiaz/8835570 to your computer and use it in GitHub Desktop.

Select an option

Save danidiaz/8835570 to your computer and use it in GitHub Desktop.
Example use of cmdargs.
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