Safe Haskell | None |
---|
- defaultMain :: String -> Transform -> IO ()
- defaultMain' :: String -> [OptDescr a] -> ([a] -> Transform) -> IO ()
Documentation
defaultMain :: String -> Transform -> IO ()Source
Creates a Unix style text processor from a Transform
.
The resulting action should be used as the main of an application
and will render a program of the given name that responds to -v
and -h
flags. If given no flags it runs the text transformer over
the standard input and output streams. If an error occurs the program
halts and prints an error message to the standard error stream.
defaultMain name transf
defaultMain' :: String -> [OptDescr a] -> ([a] -> Transform) -> IO ()Source
Like defaultMain
, but customizes the transform based on the
given options.
The help
and version
flags are added automatically.
defaultMain' name opts transf