Skip to content

gxmas/optparse-applicative-reader

Repository files navigation

reader

optparse-applicative-reader is a haskell library to provide additional readers for the optparse-applicative.

Simple example

import Control.Applicative (many)
import Control.Monad (forM_)
import Options.Applicative
import Options.Applicative.Builder.Reader

opts :: ParserInfo [NamedValue]
opts = info (many $ argument namedValue idm) idm

main :: IO ()
main = execParser opts >>= \nvs -> do
  forM_ nvs $ \nv ->
    putStrLn $ "name: " ++ fst nv ++ "  value: " ++ snd nv
$ example-exe departure="New York" arrival="Hong Kong"
name: departure  value: New York
name: arrival  value: Hong Kong
$

About

Readers for optparse-applicative library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages