packages feed

multiarg 0.24.0.0 → 0.24.0.2

raw patch · 6 files changed

+217/−150 lines, 6 filesdep ~basedep ~containers

Dependency ranges changed: base, containers

Files

+ ChangeLog view
@@ -0,0 +1,146 @@+Release 0.24.0.2, February 18, 2014+Changes since release 0.24.0.0:++* Removed upper bounds from build dependencies, and changed the+  lower bounds.++Release 0.24.0.0, September 12, 2013+Changes since release 0.20.0.0:++* Remove OneArgE, TwoArgE, etc. from Combinator module.  These data+  constructors were renamed OneArg, TwoArg, etc.  Having both OneArg+  and OneArgE was redundant.++* Improved error messages when the user enters an unrecognized option.+  Previously unrecognized options were passed through to client code+  as a positional argument; now they will be recognized as bad+  options.++Release 0.20.0.0, August 30, 2013+Changes since release 0.18.0.0:++* Remove explicit-exception; use Either instead.++Release 0.18.0.0, August 14, 2013+Changes since release 0.16.0.0:++* Rename SimpleParser module to CommandLine++* Made a number of changes to CommandLine to reorganize the data types+  and functions responsible for parsing simple and multi-mode command+  lines++* Remove GetArgs, as this was for an old library bug which has been+  fixed for some time now++Release 0.16.0.0, May 21, 2013+Changes since release 0.14.0.0:++* Rename OptArgError to InputError++* Change functions in SimpleParser to allow for positional arguments+  that might fail to be parsed++Release 0.14.0.0, April 8, 2013+Changes since release 0.12.0.2:++* Change long options to remove restrictions on what characters can+  make up a long option name. Now the only restriction is that long+  options cannot be zero length and they may not contain an equal+  sign.++Release 0.12.0.2, March 31, 2013+Changes since release 0.12.0.0:++* Reorder NEWS so recent versions are on top++* Fix bug in Prim.stopper that prevented most stoppers from being+  recognized++Release 0.12.0.0, March 27, 2013+Changes since release 0.10.0.0:++* Added value constructors to the Combinator module to allow for+  easier parsing of option arguments that can fail to parse++* Added automatic "Enter -h for help" to simpleWithHelp and+  modesWithHelp functions in SimpleParser++Release 0.10.0.0, March 7, 2013+Changes since release 0.8.0.0:++* Added the simpleWithHelp and modesWithHelp pre-built parsers to+  the SimpleParser module++* Added the mHelp field to the Mode record to allow for the+  modesWithHelp pre-built parser++* Changed the modes function in the SimpleParser module. The new+  function has a simpler type. It will however break old code.++Release 0.8.0.0, January 8, 2013+Changes since release 0.6.0.0:++* Added a multi-mode parser to SimpleParser++* All modules (except SampleParser) are now re-exported from+  System.Console.MultiArg. Therefore one import will bring in all of+  MultiArg. However, this introduced a naming conflict, because+  SimpleParser and Prim both had functions named "parse". Therefore I+  renamed SimpleParser.parse to "simple".++* Removed the <??> combinator from Prim and replaced it with+  <?>. Removed <?> from Combinator. The new <?> behaves as one would+  expect from Parsec.++* Simplified errors. There is now just one type of error message, and+  that is a string. Reversed error messages when Prim.parse returns+  (this way they are in the order the user would expect.)++* Client code written for 0.6.0.0 will probably break with this+  release, mostly because of changes to the export lists.  Combinator+  no longer re-exports from other modules, because now the expectation+  is that if you want to import everything you just import+  System.Console.MultiArg. So fixing that is just a matter of changing+  imports in client code. Other breakage will be limited to error+  handling code.++Release 0.6.0.0, September 28, 2012+Changes since release 0.4.0.0:++* Add Functor instances for OptSpec, ArgSpec++* Add ThreeArg and ChoiceArg ArgSpecs++Release 0.4.0.0, June 30, 2012+Changes since release 0.2.0.0:++* Code written for version 0.2.* will not work at all with this+  version.++* Removed dependency on text library. multiarg now only deals with+  plain Strings. The memory usage concerns that originally led me to+  use Texts were unfounded.++* Dramatically simplified code for primitive parsers. No more custom+  error types, monad transformers, or user states. This sort of+  functionality is easily implemented in the parsers that you can+  build; baking it into the primitive parsers makes things needlessly+  complicated.++* Reworked included combinators in Combinator module.++Release 0.2.0.0, April 2, 2012+Changes since release 0.1.0.0:++* Henceforth all public releases will have only even numbers in their+  release numbers (e.g. 0.2.0.0, 0.2.0.2, etc.) If a release has any+  odd numbers in its version, it is a development release.++* QuickCheck tests are removed. Eventually I will reimplement these in+  a separate library package.++* Added Feed function to System.Console.MultiArg.Prim; this allows you+  to carry out stateful parses without using a user state. Sometimes+  this aids in composability--for instance, I use it when combining+  parsers from different parts of the same program.
− NEWS
@@ -1,140 +0,0 @@-Release 0.24.0.0, September 12, 2013-Changes since release 0.20.0.0:--* Remove OneArgE, TwoArgE, etc. from Combinator module.  These data-  constructors were renamed OneArg, TwoArg, etc.  Having both OneArg-  and OneArgE was redundant.--* Improved error messages when the user enters an unrecognized option.-  Previously unrecognized options were passed through to client code-  as a positional argument; now they will be recognized as bad-  options.--Release 0.20.0.0, August 30, 2013-Changes since release 0.18.0.0:--* Remove explicit-exception; use Either instead.--Release 0.18.0.0, August 14, 2013-Changes since release 0.16.0.0:--* Rename SimpleParser module to CommandLine--* Made a number of changes to CommandLine to reorganize the data types-  and functions responsible for parsing simple and multi-mode command-  lines--* Remove GetArgs, as this was for an old library bug which has been-  fixed for some time now--Release 0.16.0.0, May 21, 2013-Changes since release 0.14.0.0:--* Rename OptArgError to InputError--* Change functions in SimpleParser to allow for positional arguments-  that might fail to be parsed--Release 0.14.0.0, April 8, 2013-Changes since release 0.12.0.2:--* Change long options to remove restrictions on what characters can-  make up a long option name. Now the only restriction is that long-  options cannot be zero length and they may not contain an equal-  sign.--Release 0.12.0.2, March 31, 2013-Changes since release 0.12.0.0:--* Reorder NEWS so recent versions are on top--* Fix bug in Prim.stopper that prevented most stoppers from being-  recognized--Release 0.12.0.0, March 27, 2013-Changes since release 0.10.0.0:--* Added value constructors to the Combinator module to allow for-  easier parsing of option arguments that can fail to parse--* Added automatic "Enter -h for help" to simpleWithHelp and-  modesWithHelp functions in SimpleParser--Release 0.10.0.0, March 7, 2013-Changes since release 0.8.0.0:--* Added the simpleWithHelp and modesWithHelp pre-built parsers to-  the SimpleParser module--* Added the mHelp field to the Mode record to allow for the-  modesWithHelp pre-built parser--* Changed the modes function in the SimpleParser module. The new-  function has a simpler type. It will however break old code.--Release 0.8.0.0, January 8, 2013-Changes since release 0.6.0.0:--* Added a multi-mode parser to SimpleParser--* All modules (except SampleParser) are now re-exported from-  System.Console.MultiArg. Therefore one import will bring in all of-  MultiArg. However, this introduced a naming conflict, because-  SimpleParser and Prim both had functions named "parse". Therefore I-  renamed SimpleParser.parse to "simple".--* Removed the <??> combinator from Prim and replaced it with-  <?>. Removed <?> from Combinator. The new <?> behaves as one would-  expect from Parsec.--* Simplified errors. There is now just one type of error message, and-  that is a string. Reversed error messages when Prim.parse returns-  (this way they are in the order the user would expect.)--* Client code written for 0.6.0.0 will probably break with this-  release, mostly because of changes to the export lists.  Combinator-  no longer re-exports from other modules, because now the expectation-  is that if you want to import everything you just import-  System.Console.MultiArg. So fixing that is just a matter of changing-  imports in client code. Other breakage will be limited to error-  handling code.--Release 0.6.0.0, September 28, 2012-Changes since release 0.4.0.0:--* Add Functor instances for OptSpec, ArgSpec--* Add ThreeArg and ChoiceArg ArgSpecs--Release 0.4.0.0, June 30, 2012-Changes since release 0.2.0.0:--* Code written for version 0.2.* will not work at all with this-  version.--* Removed dependency on text library. multiarg now only deals with-  plain Strings. The memory usage concerns that originally led me to-  use Texts were unfounded.--* Dramatically simplified code for primitive parsers. No more custom-  error types, monad transformers, or user states. This sort of-  functionality is easily implemented in the parsers that you can-  build; baking it into the primitive parsers makes things needlessly-  complicated.--* Reworked included combinators in Combinator module.--Release 0.2.0.0, April 2, 2012-Changes since release 0.1.0.0:--* Henceforth all public releases will have only even numbers in their-  release numbers (e.g. 0.2.0.0, 0.2.0.2, etc.) If a release has any-  odd numbers in its version, it is a development release.--* QuickCheck tests are removed. Eventually I will reimplement these in-  a separate library package.--* Added Feed function to System.Console.MultiArg.Prim; this allows you-  to carry out stateful parses without using a user state. Sometimes-  this aids in composability--for instance, I use it when combining-  parsers from different parts of the same program.
+ README.md view
@@ -0,0 +1,28 @@+= Multiarg++This is multiarg, a library of combinators to parse command lines.++For "released" code see Hackage:++http://hackage.haskell.org/package/multiarg++multiarg is on Github:++http://www.github.com/massysett/multiarg++== Versioning++multiarg releases are numbered in accordance with the Haskell+Package Versioning Policy.++multiarg does not set its dependencies in accordance with the+Package Versioning Policy, as I do not set upper bounds.  multiarg+is guaranteed to build with the *minimum* versions specified in the+cabal file.  I also include a dependencies.txt file that+documents more recent dependencies that are also known to work.++If you find that multiarg does not build due to dependency problems:+1) please let me know at omari@smileystation.com; 2) feel free to+add appropriate upper bounds or patches to the package as+appropriate; and 3) feel free to add command-line contraints to your+cabal command to get it to build.
+ dependencies.txt view
@@ -0,0 +1,34 @@+These dependencies were known to work with multiarg as of+2014-02-18.  multiarg is always tested to work with the lower bounds+given in the cabal file.++/opt/ghc-7.6.3/lib/ghc-7.6.3/package.conf.d:+    Cabal-1.16.0+    array-0.4.0.1+    base-4.6.0.1+    bin-package-db-0.0.0.0+    binary-0.5.1.1+    bytestring-0.10.0.2+    containers-0.5.0.0+    deepseq-1.3.0.1+    directory-1.2.0.1+    filepath-1.3.0.1+    (ghc-7.6.3)+    ghc-prim-0.3.0.0+    (haskell2010-1.1.1.0)+    (haskell98-2.0.0.2)+    hoopl-3.9.0.0+    hpc-0.6.0.0+    integer-gmp-0.5.0.0+    old-locale-1.0.0.5+    old-time-1.1.0.1+    pretty-1.1.1.0+    process-1.1.0.2+    rts-1.0+    template-haskell-2.8.0.0+    time-1.4.0.1+    unix-2.6.0.1++/home/massysett/multiarg/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d:+    multiarg-0.24.0.2+
lib/System/Console/MultiArg/Combinator.hs view
@@ -36,7 +36,6 @@ import Data.Map ((!)) import Data.Maybe (fromMaybe, mapMaybe) import Data.Monoid ( mconcat )-import Text.Read (readMaybe)   -- | @notFollowedBy p@ succeeds only if parser p fails. If p fails,@@ -90,9 +89,9 @@ -- | Reads in values that are members of Read. Provides a generic -- error message if the read fails. reader :: Read a => String -> Either InputError a-reader s = case readMaybe s of-  Just a -> return a-  Nothing -> Left . ErrorMsg $ "could not parse option argument"+reader s = case reads s of+  (x, ""):[] -> return x+  _ -> Left . ErrorMsg $ "could not parse option argument"  -- | Reads in values that are members of Read, but the value does not -- have to appear on the command line. Provides a generic error@@ -104,8 +103,8 @@   -> Either InputError (Maybe a) optReader ms = case ms of   Nothing -> return Nothing-  Just s -> case readMaybe s of-    Just a -> return (Just a)+  Just s -> case reads s of+    (x, ""):[] -> return (Just x)     _ -> Left . ErrorMsg $ "could not parse option argument"  -- | Indicates errors when parsing options to arguments.
multiarg.cabal view
@@ -1,5 +1,5 @@ Name: multiarg-Version: 0.24.0.0+Version: 0.24.0.2 Cabal-version: >=1.8 Build-Type: Simple License: BSD3@@ -12,7 +12,7 @@ Category: Console, Parsing License-File: LICENSE synopsis: Combinators to build command line parsers-extra-source-files: NEWS+extra-source-files: ChangeLog, README.md, dependencies.txt  description: multiarg is a parser combinator library to build command  line parsers. With it you can easily create parsers with options@@ -35,8 +35,8 @@  Library   Build-depends:-      base ==4.6.*-    , containers ==0.5.*+      base >=4.5.1.0 && < 5+    , containers >=0.4.2.1    hs-source-dirs: lib