ssn/src/failWithError.ts

8 lines
219 B
TypeScript
Raw Normal View History

2018-07-05 02:06:19 +02:00
export default function failWithError(usage: string, msg?: string) {
if (msg !== undefined) {
2018-07-05 02:09:26 +02:00
process.stderr.write(`Error: ${msg.trim()}\n`);
2018-07-05 02:06:19 +02:00
}
process.stderr.write(`Usage: ${usage} \n`);
process.exit(1);
}