Hello community, here is the log from the commit of package ghc-optparse-applicative for openSUSE:Factory checked in at 2019-10-18 14:34:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-optparse-applicative (Old) and /work/SRC/openSUSE:Factory/.ghc-optparse-applicative.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-optparse-applicative" Fri Oct 18 14:34:23 2019 rev:13 rq:737206 version:0.15.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-optparse-applicative/ghc-optparse-applicative.changes 2019-07-29 17:26:40.638295860 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-optparse-applicative.new.2352/ghc-optparse-applicative.changes 2019-10-18 14:34:25.100085494 +0200 @@ -1,0 +2,9 @@ +Fri Sep 13 10:29:54 UTC 2019 - psim...@suse.com + +- Update optparse-applicative to version 0.15.1.0. + Upstream has edited the change log file since the last release in + a non-trivial way, i.e. they did more than just add a new entry + at the top. You can review the file at: + http://hackage.haskell.org/package/optparse-applicative-0.15.1.0/src/CHANGELOG.md + +------------------------------------------------------------------- Old: ---- optparse-applicative-0.15.0.0.tar.gz New: ---- optparse-applicative-0.15.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-optparse-applicative.spec ++++++ --- /var/tmp/diff_new_pack.odAh5Y/_old 2019-10-18 14:34:25.720083879 +0200 +++ /var/tmp/diff_new_pack.odAh5Y/_new 2019-10-18 14:34:25.724083869 +0200 @@ -19,7 +19,7 @@ %global pkg_name optparse-applicative %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.15.0.0 +Version: 0.15.1.0 Release: 0 Summary: Utilities and combinators for parsing command line options License: BSD-3-Clause ++++++ optparse-applicative-0.15.0.0.tar.gz -> optparse-applicative-0.15.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-applicative-0.15.0.0/CHANGELOG.md new/optparse-applicative-0.15.1.0/CHANGELOG.md --- old/optparse-applicative-0.15.0.0/CHANGELOG.md 2019-07-05 10:59:39.000000000 +0200 +++ new/optparse-applicative-0.15.1.0/CHANGELOG.md 2019-09-12 13:53:27.000000000 +0200 @@ -1,3 +1,13 @@ +## Version 0.15.1.0 (12 Sep 2019) + +- Improve printing of brief descriptions for parsers. + Previously, the logical structure of the parser, + such as alternative groups and segments which must + be defined together, did not influence the layout of + the brief description. This could lead to some help + texts being difficult to read. Now, we use nesting + and forced line breaks to help improve readability. + ## Version 0.15.0.0 (05 Jul 2019) - Add support for GHC 8.8.1. @@ -11,7 +21,7 @@ - Improve rendering of complex nested parse structures. Previously, brackets and parenthesis did not respect whether or not options had to be defined together. - Now the parse tree is more accurately represeted in + Now the parse tree is more accurately represented in the help text. - Add `helpLongEquals` modifier, which will change how diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-applicative-0.15.0.0/README.md new/optparse-applicative-0.15.1.0/README.md --- old/optparse-applicative-0.15.0.0/README.md 2019-07-05 10:59:39.000000000 +0200 +++ new/optparse-applicative-0.15.1.0/README.md 2019-09-12 13:53:27.000000000 +0200 @@ -5,8 +5,8 @@ [![Hackage-Deps][hackage-deps-png]][hackage-deps] optparse-applicative is a haskell library for parsing options on -the command line, providing a powerful [applicative] interface -for composing these options. +the command line, and providing a powerful [applicative] interface +for composing them. optparse-applicative takes care of reading and validating the arguments passed to the command line, handling and reporting errors, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-applicative-0.15.0.0/optparse-applicative.cabal new/optparse-applicative-0.15.1.0/optparse-applicative.cabal --- old/optparse-applicative-0.15.0.0/optparse-applicative.cabal 2019-07-05 10:59:39.000000000 +0200 +++ new/optparse-applicative-0.15.1.0/optparse-applicative.cabal 2019-09-12 13:53:27.000000000 +0200 @@ -1,5 +1,5 @@ name: optparse-applicative -version: 0.15.0.0 +version: 0.15.1.0 synopsis: Utilities and combinators for parsing command line options description: optparse-applicative is a haskell library for parsing options diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-applicative-0.15.0.0/src/Options/Applicative/Help/Core.hs new/optparse-applicative-0.15.1.0/src/Options/Applicative/Help/Core.hs --- old/optparse-applicative-0.15.0.0/src/Options/Applicative/Help/Core.hs 2019-07-05 10:59:39.000000000 +0200 +++ new/optparse-applicative-0.15.1.0/src/Options/Applicative/Help/Core.hs 2019-09-12 13:53:27.000000000 +0200 @@ -112,7 +112,7 @@ , descHidden = False } -- | Wrap a doc in parentheses or brackets if required. -wrap :: AltNodeType -> (Chunk Doc, Wrapping) -> Chunk Doc +wrap :: AltNodeType -> (Chunk Doc, Wrapping) -> Chunk Doc wrap altnode (chunk, wrapping) | altnode == MarkDefault = fmap brackets chunk @@ -130,15 +130,17 @@ = (foldr ((<</>>) . wrap NoDefault . foldTree) mempty xs, Bare) foldTree (AltNode b xs) = (\x -> (x, Bare)) + . fmap groupOrNestLine . wrap b . alt_node . filter (not . isEmpty . fst) . map foldTree $ xs where + alt_node :: [(Chunk Doc, Wrapping)] -> (Chunk Doc, Wrapping) alt_node [n] = n alt_node ns = (\y -> (y, Wrapped)) - . foldr (chunked (\x y -> x </> char '|' </> y) . wrap NoDefault) mempty + . foldr (chunked altSep . wrap NoDefault) mempty $ ns -- | Generate a full help text for a parser. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/optparse-applicative-0.15.0.0/src/Options/Applicative/Help/Pretty.hs new/optparse-applicative-0.15.1.0/src/Options/Applicative/Help/Pretty.hs --- old/optparse-applicative-0.15.0.0/src/Options/Applicative/Help/Pretty.hs 2019-07-05 10:59:39.000000000 +0200 +++ new/optparse-applicative-0.15.1.0/src/Options/Applicative/Help/Pretty.hs 2019-09-12 13:53:27.000000000 +0200 @@ -1,10 +1,56 @@ module Options.Applicative.Help.Pretty ( module Text.PrettyPrint.ANSI.Leijen , (.$.) + , groupOrNestLine + , altSep ) where -import Text.PrettyPrint.ANSI.Leijen hiding ((<$>), (<>), columns) +import Control.Applicative +import Data.Semigroup ((<>)) + +import Text.PrettyPrint.ANSI.Leijen hiding ((<$>), (<>), columns) +import Text.PrettyPrint.ANSI.Leijen.Internal (Doc (..), flatten) import qualified Text.PrettyPrint.ANSI.Leijen as PP +import Prelude + (.$.) :: Doc -> Doc -> Doc (.$.) = (PP.<$>) + + +-- | Apply the function if we're not at the +-- start of our nesting level. +ifNotAtRoot :: (Doc -> Doc) -> Doc -> Doc +ifNotAtRoot f doc = + Nesting $ \i -> + Column $ \j -> + if i == j + then doc + else f doc + + +-- | Render flattened text on this line, or start +-- a new line before rendering any text. +-- +-- This will also nest subsequent lines in the +-- group. +groupOrNestLine :: Doc -> Doc +groupOrNestLine = + Union + <$> flatten + <*> ifNotAtRoot (line <>) . nest 2 + + +-- | Separate items in an alternative with a pipe. +-- +-- If the first document and the pipe don't fit +-- on the line, then mandatorily flow the next entry +-- onto the following line. +-- +-- The (<//>) softbreak ensures that if the document +-- does fit on the line, there is at least a space, +-- but it's possible for y to still appear on the +-- next line. +altSep :: Doc -> Doc -> Doc +altSep x y = + group (x <+> char '|' <> line) <//> y