Closed hyrious closed 1 year ago
Repro:
let renderHelp = require("render-help") console.log('width =', process.stdout.columns) console.log(renderHelp({ usages: ['pnpm add [options]'], descriptionLists: [ { title: 'Options', list: [ { name: '--filter', description: `averylongsentenceaverylongsentenceaverylongsentenceaverylongsentenceaverylo` } ] } ] }))
Prints:
width = 100 Usage: pnpm add [options] Options: --filter averylongsentenceaverylongsentenceaverylongsentenceaverylongsentenceavery lo // <- terminal wraps the line, actually no \n
Edit:
https://github.com/zkochan/packages/blob/7eab98947a769d3ccefb188f9c82e434b74236dc/render-help/src/index.ts#L79
Change the - 1 to - 3 should fix this issue.
- 1
- 3
Repro:
Prints:
Edit:
https://github.com/zkochan/packages/blob/7eab98947a769d3ccefb188f9c82e434b74236dc/render-help/src/index.ts#L79
Change the
- 1
to- 3
should fix this issue.