The optparse-text package

[Tags:bsd3, library, test]

Please see README.md


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0
Dependencies base (>=4.6 && <5), optparse-applicative, text [details]
License BSD3
Author Pascal Hartig
Maintainer Pascal Hartig <i@passy.me>
Category Development
Home page https://github.com/passy/optparse-text#readme
Bug tracker https://github.com/passy/optparse-text/issues
Source repository head: git clone https://github.com/passy/optparse-text
Uploaded Sun Jun 26 10:48:27 UTC 2016 by passy
Distributions LTSHaskell:0.1.1.0, NixOS:0.1.1.0, Stackage:0.1.1.0, Tumbleweed:0.1.1.0
Downloads 109 total (10 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-06-26 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for optparse-text

Readme for optparse-text-0.1.1.0

optparse-text

Build Status

Helpers for optparse-applicative to deal with Data.Text.

Example

import qualified Data.Text                 as T
import qualified Options.Applicative       as Opt
import qualified Options.Applicative.Text  as OptT

data Options = Options { text    :: T.Text
                       , textArg :: T.Text
                       , textOpt :: T.Text }
  deriving (Eq, Show)

optParser :: Opt.Parser Options
optParser = Options <$> Opt.argument OptT.text ( Opt.metavar "TEXT" )
                 <*> OptT.textArgument ( Opt.metavar "TEXT2" )
                 <*> OptT.textOption ( Opt.long "textopt" )

Status

About to be published.

Alternatives

You may want to consider using optparse-generic which has built-in support for Text and provides a very convient generic interface to optparse avoiding a lot of boilerplate.