Permalink
Browse files

optimist for arguments

  • Loading branch information...
1 parent 715e255 commit 3611fc1d1da93a3aa88d7daa65de31363a59bd60 @netroy committed Nov 13, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 index.js
View
@@ -7,16 +7,21 @@
'use strict';
var socketIO = require('socket.io');
- var optmist = require('optimist');
+ var optimist = require('optimist');
var connect = require('connect');
var stylus = require('stylus');
var http = require('http');
var fs = require('fs');
var path = require('path');
+ var argv = optimist.usage('Usage: $0 --watch [file or directory to watch]')
+ .demand(['watch'])
+ .default('watch', '/tmp')
+ .argv;
+
// Directory to watch
- var logDir = process.argv.length > 2 ? process.argv[2] : "/tmp";
+ var logDir = argv.watch;
// Create an connect app
var app = connect();

0 comments on commit 3611fc1

Please sign in to comment.