Skip to content

Commit

Permalink
[Chore] Do not use removed functions from Options.Applicative.Help.Pr…
Browse files Browse the repository at this point in the history
…etty

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.
  • Loading branch information
int-index committed Sep 25, 2024
1 parent f774ba4 commit 74ed941
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Xrefcheck/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \"<!-- xrefcheck: ignore <mode> -->\"\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.")
Expand All @@ -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

0 comments on commit 74ed941

Please sign in to comment.