From 74ed94155c56aa9dc6fd09953e27131d740ce63a Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Wed, 18 Sep 2024 01:47:46 +0300 Subject: [PATCH] [Chore] Do not use removed functions from Options.Applicative.Help.Pretty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: build failure with newer versions of optparse-applicative Module ‘Options.Applicative.Help.Pretty’ does not export ‘displayS’ Module ‘Options.Applicative.Help.Pretty’ does not export ‘renderPretty’ Module ‘Options.Applicative.Help.Pretty’ does not export ‘text’ Solution: stop using functions that have been removed. --- src/Xrefcheck/CLI.hs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Xrefcheck/CLI.hs b/src/Xrefcheck/CLI.hs index 2db27f43..58d7094f 100644 --- a/src/Xrefcheck/CLI.hs +++ b/src/Xrefcheck/CLI.hs @@ -31,7 +31,7 @@ import Options.Applicative (Mod, OptionFields, Parser, ReadM, auto, command, eitherReader, execParser, flag, flag', footerDoc, fullDesc, help, helpDoc, helper, hsubparser, info, infoOption, long, metavar, option, progDesc, short, strOption, switch, value) -import Options.Applicative.Help.Pretty (Doc, displayS, fill, fillSep, indent, renderPretty, text) +import Options.Applicative.Help.Pretty (Doc, fill, fillSep, indent, pretty) import Options.Applicative.Help.Pretty qualified as Pretty import Text.Interpolation.Nyan @@ -289,17 +289,13 @@ getCommand = do footerDoc (pure ignoreModesMsg) ignoreModesMsg :: Doc -ignoreModesMsg = text $ header <> body +ignoreModesMsg = text header <> body where header = "To ignore a link in your markdown, \ \include \"\"\n\ \comment with one of these modes:\n" - body = displayS (renderPretty pageParam pageWidth doc) "" - pageWidth = 80 - pageParam = 1 - - doc = fillSep $ map formatDesc modeDescr + body = fillSep $ map formatDesc modeDescr modeDescr = [ (" \"link\"", L.words "Ignore the link right after the comment.") @@ -314,3 +310,6 @@ ignoreModesMsg = text $ header <> body formatDesc (mode, descr) = fill modeIndent (text mode) <> indent descrIndent (fillSep $ map text descr) + +text :: String -> Doc +text = pretty