butcher 1.1.0.1 → 1.1.0.2
raw patch · 4 files changed
+19/−12 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- UI.Butcher.Monadic: cmd_out :: forall out_ahpi. Lens' (CommandDesc out_ahpi) (Maybe out_ahpi)
+ UI.Butcher.Monadic: cmd_out :: forall out_ag6I. Lens' (CommandDesc out_ag6I) (Maybe out_ag6I)
- UI.Butcher.Monadic.Types: cmd_out :: forall out_ahpi. Lens' (CommandDesc out_ahpi) (Maybe out_ahpi)
+ UI.Butcher.Monadic.Types: cmd_out :: forall out_ag6I. Lens' (CommandDesc out_ag6I) (Maybe out_ag6I)
Files
- ChangeLog.md +4/−0
- butcher.cabal +3/−3
- src/UI/Butcher/Monadic.hs +2/−2
- src/UI/Butcher/Monadic/Pretty.hs +10/−7
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for cmdparse-applicative +## 1.1.0.2 -- September 2017++* Improve 'usage' pretty-printing+ ## 1.1.0.1 -- August 2017 * Adapt for ghc-8.2
butcher.cabal view
@@ -1,11 +1,11 @@ name: butcher-version: 1.1.0.1+version: 1.1.0.2 synopsis: Chops a command or program invocation into digestable pieces.-description: See the README (it is properly formatted on github)+description: See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it is properly formatted on github). license: BSD3 license-file: LICENSE author: Lennart Spitzner-maintainer: hexagoxel@hexagoxel.de+maintainer: Lennart Spitzner <hexagoxel@hexagoxel.de> copyright: Copyright (C) 2016-2017 Lennart Spitzner category: UI build-type: Simple
src/UI/Butcher/Monadic.hs view
@@ -79,8 +79,8 @@ -- | Wrapper around 'runCmdParser' for very simple usage: Accept a @String@--- input and return only the output from the parser, returning @Nothing@ in--- any error case.+-- input and return only the output from the parser, or a plain error string+-- on failure. runCmdParserSimple :: String -> CmdParser Identity out () -> Either String out runCmdParserSimple s p = case snd $ runCmdParser Nothing (InputString s) p of Left e -> Left $ parsingErrorString e
src/UI/Butcher/Monadic/Pretty.hs view
@@ -59,7 +59,7 @@ -- > playground [--short] NAME [version | help] ppUsage :: CommandDesc a -> PP.Doc ppUsage (CommandDesc mParent _help _syn parts out children) = pparents mParent- <+> PP.fsep (partDocs ++ [subsDoc])+ <+> PP.sep [PP.fsep partDocs, subsDoc] where pparents :: Maybe (String, CommandDesc out) -> PP.Doc pparents Nothing = PP.empty@@ -208,12 +208,15 @@ PartWithHelp _ p -> rec p PartReorder ps -> let flags = [ d | PartMany d <- ps ]- params = filter ( \case- PartMany{} -> False- _ -> True- )- ps- in PP.brackets (PP.fsep $ rec <$> flags) <+> PP.fsep (rec <$> params)+ params = filter+ ( \case+ PartMany{} -> False+ _ -> True+ )+ ps+ in PP.sep+ [(PP.fsep $ PP.brackets . rec <$> flags), PP.fsep (rec <$> params)]+ where rec = ppPartDescUsage