   .check((argv) ->
     if argv.reporters == true
       showReporters()
-      process.exit 0
+      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

yargs = require 'yargs'
Abao = require '../lib/abao'
pkg = require '../package'

showReporters = () ->
  # Copied from node_modules/mocha/_mocha


abao.run (error, nfailures) ->
  if error
    process.exitCode = EXIT_FAILURE
    if error.message
      console.error error.message
    if error.stack
      console.error error.stack

  if nfailures > 0
    process.exitCode = EXIT_FAILURE

  process.exit()

