   outputPath = cli.argv.output
   outputPath = path.resolve(outputPath) if outputPath
 
+  delexe = new Delexe()
+
+  output = (outputPath, string) ->
+    if outputPath
+      fs.writeFileSync(outputPath, string)
+    else
+      console.log(string)
+
   if filePath
     filePath = path.resolve(filePath)
     unless fs.isFileSync(filePath)

fs = require 'fs-plus'
CSON = require 'season'
optimist = require 'optimist'
delexe = require './delexe'

module.exports = ->
  cli = optimist.describe('h', 'Show this message').alias('h', 'help')

      process.exit(1)
      return

    string = delexe.renderSync({filePath: outputPath, scopeName: cli.argv.scope})
    output outputPath, string
  else
    filePath = cli.argv.f or outputPath
    process.stdin.resume()
