// Generated by CoffeeScript 1.4.0
var changes, cwd, path, watchPath, watchr,
  __slice = [].slice;

path = require('path');

watchr = require(__dirname + '/../lib/watchr');

cwd = process.cwd();

watchPath = process.argv.length === 3 ? path.resolve(cwd, process.argv[2]) : cwd;

changes = 0;

watchr.watch({
  path: watchPath,
  listener: function() {
    var args;
    args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    return console.log('a watch event occured:', ++changes, ':', args);
  },
  next: function(err, watcher) {
    if (err) {
      throw err;
    }
    return console.log('now watching:', watchPath);
  }
});
