Skip to content

Commit

Permalink
Nest friendly ANSI treatment in CLI help
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Aug 16, 2021
1 parent ae86db5 commit dfb212c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/optparse-applicative
tag: 399a5f8194d90eaedb223ea609a872d64163a453
--sha256: 0nih7aa3h5w2aq5pb87py8nqsxikbfg24h2348dry5l5s1y0iizd
tag: 84bcc6f18992a441886589a117249bfface8630e
--sha256: 09pr7m9gjsk8889m9d3mj75p69viv1acnrq63dgb11jl5gnnsblr

source-repository-package
type: git
Expand Down
5 changes: 2 additions & 3 deletions cardano-cli/src/Cardano/CLI/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import Cardano.Prelude
import Data.Function (id)
import Options.Applicative
import Options.Applicative.Help.Ann
import Options.Applicative.Help.Types (helpText)
import Options.Applicative.Help.Types (helpText, renderHelp)
import Prelude (String)
import Prettyprinter
import Prettyprinter.Render.Util.SimpleDocTree
import Options.Applicative.Help.Types (renderHelp)

import qualified Data.Text as T
import qualified System.Environment as IO
Expand Down Expand Up @@ -45,7 +44,7 @@ customRenderHelpAsHtml cols
then case ann of
AnnTrace _ name -> "<span name=" <> show name <> ">" <> x <> "</span>"
AnnStyle _ -> x
else flip const
else x
wrapper = if cliHelpTraceEnabled
then id
. ("<html>\n" <>)
Expand Down

0 comments on commit dfb212c

Please sign in to comment.