@@ -2,7 +2,7 @@ var path = require("path");
22var fs = require ( "fs" ) ;
33fs . existsSync = fs . existsSync || path . existsSync ;
44var resolve = require ( "enhanced-resolve" ) ;
5- var interpret = require ( ' interpret' ) ;
5+ var interpret = require ( " interpret" ) ;
66
77module . exports = function ( optimist , argv , convertOptions ) {
88
@@ -68,18 +68,19 @@ module.exports = function(optimist, argv, convertOptions) {
6868 }
6969
7070 if ( argv . context ) {
71- options . context = path . resolve ( argv . context )
71+ options . context = path . resolve ( argv . context ) ;
7272 }
7373 if ( ! options . context ) {
7474 options . context = process . cwd ( ) ;
7575 }
7676
7777 if ( argv [ "watch" ] ) {
78- options . watch = true ;
78+ options . doWatch = true ;
7979 }
8080
8181 if ( argv [ "watch-delay" ] ) {
82- options . watchDelay = + argv [ "watch-delay" ] ;
82+ options . watch = options . watch || { } ;
83+ options . watch . aggregateTimeout = + argv [ "watch-delay" ] ;
8384 }
8485
8586 function processOptions ( options ) {
@@ -92,7 +93,7 @@ module.exports = function(optimist, argv, convertOptions) {
9293 if ( finalize ) {
9394 finalize ( ) ;
9495 }
95- } else if ( typeof argv [ name ] != "undefined" ) {
96+ } else if ( typeof argv [ name ] !== "undefined" ) {
9697 if ( init ) {
9798 init ( ) ;
9899 }
@@ -109,7 +110,7 @@ module.exports = function(optimist, argv, convertOptions) {
109110 if ( i < 0 ) {
110111 return fn ( null , content , idx ) ;
111112 } else {
112- return fn ( content . substr ( 0 , i ) , content . substr ( i + 1 ) , idx ) ;
113+ return fn ( content . substr ( 0 , i ) , content . substr ( i + 1 ) , idx ) ;
113114 }
114115 } , init , finalize ) ;
115116 }
@@ -468,7 +469,7 @@ module.exports = function(optimist, argv, convertOptions) {
468469 addTo ( "main" , content ) ;
469470 }
470471 } else {
471- addTo ( content . substr ( 0 , i ) , content . substr ( i + 1 ) ) ;
472+ addTo ( content . substr ( 0 , i ) , content . substr ( i + 1 ) ) ;
472473 }
473474 } ) ;
474475 }
0 commit comments