 #  2. dirator = require('dirator')
 #     dirator options
 #  3. require('dirator')(options)
-module.exports = (args...) -> new Dirator(args...).run()
+module.exports = (options, done) -> new Dirator(options, done).run()
 module.exports.Dirator = Dirator
 
 # Provide convenience functions prebuilt with mode:

    for event in ['file', 'dir', 'path']
      if options[event]?
        @on event, options[event]
        @only.push event + 's'

    # add the array callbacks, when specfied. add the type to `only`
    for event in ['files', 'dirs', 'paths']
      if options[event]?
        @on event, options[event]
        if event not in @only then @only.push event

    # store both accept filters provided (when not provided, they become undefined)
    for accept in ['acceptString', 'acceptPath']
      @['_' + accept] = options[accept]

    # always recurse unless options specify *not* to
    if options.recurse isnt false then @recurse = true

    # override `only` settings from events when `only` is explicitly set in options
    if options.only? then @only = options.only

  run: (options, done) ->

    # if they specified options, done, or both, then reconfigure
    if options? or done? then @_configure options, done

    # there must be a `target` for us to start at
    unless @target? then throw new Error 'dirator requires a `target` to run'
