()
| 15 | `.trim(); |
| 16 | |
| 17 | export function getHelpString(): string { |
| 18 | let result = helpString + "\n\n"; |
| 19 | |
| 20 | result += "Options:\n"; |
| 21 | for (const option of optionDeclarations) { |
| 22 | const aliasStrings = (option.aliases ?? []).map(a => "-" + a); |
| 23 | const optionString = [...aliasStrings, "--" + option.name].join("|"); |
| 24 | |
| 25 | const valuesHint = option.type === "enum" ? option.choices.join("|") : option.type; |
| 26 | const spacing = " ".repeat(Math.max(1, 45 - optionString.length - valuesHint.length)); |
| 27 | |
| 28 | result += `\n ${optionString} <${valuesHint}>${spacing}${option.description}\n`; |
| 29 | } |
| 30 | |
| 31 | return result; |
| 32 | } |
no outgoing calls
no test coverage detected