summaryrefslogtreecommitdiff
path: root/node_modules/yaml/bin.mjs
blob: 7504ae13b9fdfb26da9e7aa5be4d881882d10c8d (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env node

import { UserError, cli, help } from './dist/cli.mjs'

cli(process.stdin, error => {
  if (error instanceof UserError) {
    if (error.code === UserError.ARGS) console.error(`${help}\n`)
    console.error(error.message)
    process.exitCode = error.code
  } else if (error) throw error
})