   prelude: null
   watch:   false
 
-args = process.argv.slice 2
-
-entry = args.shift()
-
 if (not entry?) or entry.charAt(0) == '-'
   if entry in ['-v', '--version']
-    console.log require('../package').version
-    process.exit 0
+    version()
   else
-    help 1
+    help()
 
 while opt = args.shift()
   switch opt

#!/usr/bin/env coffee

fs = require 'fs'
requisite = require('../lib')

writeBundle = (bundle, opts) ->
  if opts.output?
    fs.writeFileSync opts.output, bundle.toString opts, 'utf8'
  else
    console.log bundle.toString opts

help = (code, message) ->
  console.log """

  Usage: requisite path/to/entry-module [options]

    -v, --version                Display version
    -h, --help                   Display this help
  """
  process.exit 0


version = ->
  console.log require('../package').version
  process.exit 0


args = process.argv.slice 2
entry = args.shift()

opts =
  entry:   entry
  bare:    false
  include: []
  exclude: null
