({
options,
commandPath,
depth,
}: BuildOptionEntriesArgs)
| 304 | }; |
| 305 | |
| 306 | function buildOptionEntries({ |
| 307 | options, |
| 308 | commandPath, |
| 309 | depth, |
| 310 | }: BuildOptionEntriesArgs): Content[] { |
| 311 | const nodes: Content[] = []; |
| 312 | const headingDepth = Math.min(depth + 1, 6); |
| 313 | |
| 314 | options.forEach((option) => { |
| 315 | const signature = formatOptionSignature(option); |
| 316 | nodes.push(createHeading(headingDepth, [createInlineCode(signature)])); |
| 317 | |
| 318 | nodes.push({ |
| 319 | type: "code", |
| 320 | lang: "bash", |
| 321 | value: buildOptionUsage(commandPath, option), |
| 322 | }); |
| 323 | |
| 324 | if (option.description) { |
| 325 | nodes.push(createParagraph(option.description)); |
| 326 | } |
| 327 | |
| 328 | const details = buildOptionDetails(option); |
| 329 | if (details.length > 0) { |
| 330 | nodes.push(createParagraph(details.join(" "))); |
| 331 | } |
| 332 | }); |
| 333 | |
| 334 | return nodes; |
| 335 | } |
| 336 | |
| 337 | function buildArgumentListItems(args: readonly Argument[]): ListItem[] { |
| 338 | return args.map((arg) => { |
no test coverage detected