Copyright | (c) Fumiaki Kinoshita 2017 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
A wrapper for GetOpt
- data OptDescr' a = OptDescr' a (OptDescr (a -> a))
- optNoArg :: [Char] -> [String] -> String -> OptDescr' Int
- optReqArg :: [Char] -> [String] -> String -> String -> OptDescr' [String]
- getOptRecord :: RecordOf OptDescr' xs -> [String] -> (Record xs, [String], [String], String -> String)
- withGetOpt :: MonadIO m => RecordOf OptDescr' xs -> (Record xs -> [String] -> m a) -> m a
Documentation
OptDescr
with a default
Option without an argument; the result is the total count of this option.
:: [Char] | short option |
-> [String] | long option |
-> String | placeholder |
-> String | explanation |
-> OptDescr' [String] |
Option with an argument
withGetOpt :: MonadIO m => RecordOf OptDescr' xs -> (Record xs -> [String] -> m a) -> m a Source #
When there's an error, print it along with the usage info to stderr
and terminate with exitFailure
.