optparse-applicative 0.13.1.0 → 0.13.2.0
raw patch · 3 files changed
+39/−64 lines, 3 filesdep ~basedep ~process
Dependency ranges changed: base, process
Files
- CHANGELOG.md +6/−0
- Options/Applicative/Help.hs +21/−5
- optparse-applicative.cabal +12/−59
CHANGELOG.md view
@@ -1,3 +1,9 @@+## Version 0.13.2.0 (9 Mar 2017)++- Updated dependency bounds.++- Doc+ ## Version 0.13.1.0 (10 Feb 2017) - Updated dependency bounds.
Options/Applicative/Help.hs view
@@ -1,8 +1,24 @@ module Options.Applicative.Help (- module X+ -- | This is an empty module which re-exports+ -- the help text system for optparse.++ -- | Pretty printer. Reexports most combinators+ -- from Text.PrettyPrint.ANSI.Leijen+ module Options.Applicative.Help.Pretty,++ -- | A free monoid over Doc with helpers for+ -- composing help text components.+ module Options.Applicative.Help.Chunk,++ -- | Types required by the help system.+ module Options.Applicative.Help.Types,++ -- | Core implementation of the help text+ -- generator.+ module Options.Applicative.Help.Core, ) where -import Options.Applicative.Help.Pretty as X-import Options.Applicative.Help.Chunk as X-import Options.Applicative.Help.Types as X-import Options.Applicative.Help.Core as X+import Options.Applicative.Help.Pretty+import Options.Applicative.Help.Chunk+import Options.Applicative.Help.Types+import Options.Applicative.Help.Core
optparse-applicative.cabal view
@@ -1,66 +1,19 @@ name: optparse-applicative-version: 0.13.1.0+version: 0.13.2.0 synopsis: Utilities and combinators for parsing command line options description:- Here is a simple example of an applicative option parser:- .- @- data Sample = Sample-   { hello :: String-   , quiet :: Bool }- .- sample :: Parser Sample- sample = Sample-   \<$\> strOption-   ( long \"hello\"-   \<\> metavar \"TARGET\"-   \<\> help \"Target for the greeting\" )-   \<*\> switch-   ( long \"quiet\"-   \<\> help \"Whether to be quiet\" )- @- .- The parser is built using applicative style starting from a set of basic- combinators. In this example, @hello@ is defined as an 'option' with a- @String@ argument, while @quiet@ is a boolean 'flag' (called 'switch').- .- A parser can be used like this:- .- @- greet :: Sample -> IO ()- greet (Sample h False) = putStrLn $ \"Hello, \" ++ h- greet _ = return ()- .- main :: IO ()- main = execParser opts \>\>= greet-   where-   opts = info (helper \<*\> sample)-   ( fullDesc-   \<\> progDesc \"Print a greeting for TARGET\"-   \<\> header \"hello - a test for optparse-applicative\" )- @- .- The @greet@ function is the entry point of the program, while @opts@ is a- complete description of the program, used when generating a help text. The- 'helper' combinator takes any parser, and adds a @help@ option to it (which- always fails).- .- The @hello@ option in this example is mandatory (since it doesn't have a- default value), so running the program without any argument will display a- help text:+ optparse-applicative is a haskell library for parsing options+ on the command line, providing a powerful applicative interface+ for composing these options. .- >hello - a test for optparse-applicative- >- >Usage: hello --hello TARGET [--quiet]- > Print a greeting for TARGET- >- >Available options:- > -h,--help Show this help text- > --hello TARGET Target for the greeting- > --quiet Whether to be quiet+ optparse-applicative takes care of reading and validating the+ arguments passed to the command line, handling and reporting+ errors, generating a usage line, a comprehensive help screen,+ and enabling context-sensitive bash completions. .- containing a short usage summary, and a detailed list of options with- descriptions.+ See the included README for detailed instructions and examples,+ which is also available on github+ <https://github.com/pcapriotti/optparse-applicative>. license: BSD3 license-file: LICENSE author: Paolo Capriotti, Huw Campbell@@ -123,7 +76,7 @@ build-depends: base == 4.* , transformers >= 0.2 && < 0.6 , transformers-compat >= 0.3 && < 0.6- , process >= 1.0 && < 1.6+ , process >= 1.0 && < 1.7 , ansi-wl-pprint >= 0.6.6 && < 0.7 if !impl(ghc >= 8)