packages feed

optparse-applicative-simple 1.0.1 → 1.0.2

raw patch · 2 files changed

+19/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ OptparseApplicative.Simple.Parser: lenientArgument :: LenientParser a => Text -> Maybe Char -> Maybe Text -> Maybe (a, Text) -> Parser a

Files

library/OptparseApplicative/Simple/Parser.hs view
@@ -2,6 +2,7 @@ (   Parser,   argument,+  lenientArgument, ) where @@ -10,6 +11,7 @@ import qualified Options.Applicative as A import qualified Data.Attoparsec.Text as B import qualified Data.Text as C+import qualified Attoparsec.Data as D   {-|@@ -36,6 +38,21 @@   where     readM =       A.eitherReader (B.parseOnly parser . C.pack)+    mods =+      A.long (C.unpack longName) <>+      foldMap A.short shortName <>+      foldMap (A.help . C.unpack) description <>+      foldMap (\(value, text) -> A.value value <> A.showDefaultWith (const (C.unpack text))) defaultValue++{-|+Same as 'argument', only provided with a default parser.+-}+lenientArgument :: D.LenientParser a => Text -> Maybe Char -> Maybe Text -> Maybe (a, Text) -> A.Parser a+lenientArgument longName shortName description defaultValue =+  A.option readM mods+  where+    readM =+      A.eitherReader (B.parseOnly D.lenientParser . C.pack)     mods =       A.long (C.unpack longName) <>       foldMap A.short shortName <>
optparse-applicative-simple.cabal view
@@ -1,7 +1,7 @@ name:   optparse-applicative-simple version:-  1.0.1+  1.0.2 category:   CLI, Parsing, Options synopsis:@@ -54,6 +54,7 @@     --      optparse-applicative >= 0.14 && < 0.15,     attoparsec == 0.13.*,+    attoparsec-data == 1.*,     --      text == 1.*,     base-prelude < 2