howCommandTree :: Params -> Config -> TreeOptions -> IO ()
showCommandTree Params{colour} Config{commands} treeOptions =
    putDoc (commandTree treeOptions descriptions <> Pretty.line)
  where
    descriptions :: [SubcommandDescription Text (Maybe (Doc TreeAnn))]
    descriptions = commands <&> \NamedCommand{name, description} ->
        SubcommandDescription
            { name = name
            , description =
                Pretty.annotate NodeDescription . pretty <$> description
            }

    putDoc = hPutDoc defaultLayoutOptions treeAnnToAnsi colour stdout

showCommandTree :: Params -> Config -> TreeOptions -> IO ()
showCommandTree Params{colour} Config{commands} treeOptions =
    putDoc (commandTree treeOptions descriptions <> Pretty.line)
  where
    descriptions :: [SubcommandDescription Text (Maybe (Doc TreeAnn))]
    descriptions = commands <&> \NamedCommand{name, description} ->
        SubcommandDescription
            { name = name
            , description =
                Pretty.annotate NodeDescription . pretty <$> description
            }

    putDoc = hPutDoc defaultLayoutOptions treeAnnToAnsi colour stdout
showCommandTree Params{colour} Config{commands} treeOptions =
    putDoc (commandTree treeOptions descriptions <> Pretty.line)
  where
    descriptions :: [SubcommandDescription Text (Maybe (Doc TreeAnn))]
    descriptions = commands <&> \NamedCommand{name, description} ->
        SubcommandDescription
            { name = name
            , description =
                Pretty.annotate NodeDescription . pretty <$> description
            }

    putDoc = hPutDoc defaultLayoutOptions treeAnnToAnsi colour stdout