optparse-text: Data.Text helpers for optparse-applicative

[ bsd3, development, library ] [ Propose Tags ] [ Report a vulnerability ]

Please see README.md


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0
Dependencies base (>=4.6 && <5), optparse-applicative, text [details]
Tested with ghc ==7.6.3, ghc ==7.8.4, ghc ==7.10.3, ghc ==8.0.1
License BSD-3-Clause
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 repo head: git clone https://github.com/passy/optparse-text
Uploaded by passy at 2016-06-26T10:48:27Z
Distributions LTSHaskell:0.1.1.0, NixOS:0.1.1.0, Stackage:0.1.1.0
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 3588 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-06-26 [all 1 reports]

Readme for optparse-text-0.1.1.0

[back to package description]

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.