 yargs = require 'yargs'
 Abao = require '../lib/abao'
 pkg = require '../package'
+
+EXIT_SUCCESS = 0
+EXIT_FAILURE = 1
 
 showReporters = () ->
   # Copied from node_modules/mocha/_mocha


abao.run (error, nfailures) ->
  if error
    if error.message
      console.error error.message
    if error.stack
      console.error error.stack
    process.exit 1

  process.exit (if nfailures > 0 then 1 else 0)


  .check((argv) ->
    if argv.reporters == true
      showReporters()
      process.exit EXIT_SUCCESS

    # Ensure single positional argument present
    if argv._.length < 1
      throw new Error binary + ': must specify path to RAML file'
    else if argv._.length > 1
