(topic: HelpTopic, format = '')
| 155 | } |
| 156 | |
| 157 | export function formatTopic(topic: HelpTopic, format = ''): string { |
| 158 | if (isStructured(format)) |
| 159 | return serialize({ name: topic.name, summary: topic.summary, body: topic.render() }, format) |
| 160 | |
| 161 | return topic.render() |
| 162 | } |
| 163 | |
| 164 | // Renders a list of commands as aligned `path description` rows, grouped by |
| 165 | // their first path segment (a blank line between groups). Shared by the |
no test coverage detected