UNPKG

310 BJavaScriptView Raw
1#!/usr/bin/env node
2
3import { UserError, cli, help } from './dist/cli.mjs'
4
5cli(process.stdin, error => {
6 if (error instanceof UserError) {
7 if (error.code === UserError.ARGS) console.error(`${help}\n`)
8 console.error(error.message)
9 process.exitCode = error.code
10 } else if (error) throw error
11})