()
| 202 | } |
| 203 | |
| 204 | async function cliMain(): Promise<void> { |
| 205 | let benchArgs: BenchArgs | undefined; |
| 206 | |
| 207 | try { |
| 208 | benchArgs = resolveAndValidateArgs(process.argv.slice(2)); |
| 209 | |
| 210 | if (benchArgs === undefined) { |
| 211 | console.log(USAGE); |
| 212 | return; |
| 213 | } |
| 214 | |
| 215 | await runBenchmark(benchArgs); |
| 216 | } catch (error) { |
| 217 | if (!(error instanceof Error)) { |
| 218 | throw error; |
| 219 | } |
| 220 | |
| 221 | logError(failureMessage(error, benchArgs)); |
| 222 | process.exitCode = 1; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * For a CommandFailedError, the message gains its captured output and only |
no test coverage detected