(questionText: string, defaultValue?: number)
| 116 | } |
| 117 | |
| 118 | export function intQuestion(questionText: string, defaultValue?: number) { |
| 119 | return parseInt( |
| 120 | prompt(questionText, { |
| 121 | limit: value => { |
| 122 | const intValue = parseInt(value, 10); |
| 123 | return !isNaN(intValue); |
| 124 | }, |
| 125 | limitMessage: errorOutput("Entered value must be an integer."), |
| 126 | prompt: `[${defaultValue}] `, |
| 127 | defaultInput: `${defaultValue}` |
| 128 | }), |
| 129 | 10 |
| 130 | ); |
| 131 | } |
| 132 | |
| 133 | export function selectionQuestion(questionText: string, options: string[]) { |
| 134 | return readlineSync.keyInSelect(options, `${questionText}\n`, { |
nothing calls this directly
no test coverage detected