@@ -189,7 +189,7 @@ program.option('-c --config-file <file>', 'Use config file', function(configPath
189189} ) ;
190190program . option ( '--input-dir <dir>' , 'Specify an input directory' ) ;
191191program . option ( '--output-dir <dir>' , 'Specify an output directory' ) ;
192- program . option ( '--file-ext <text>' , 'Specify an extension to be read, ex: html' ) ;
192+ program . option ( '--file-ext <text>' , 'Specify extensions to be read, separated by commas, ex: html,htm,xml ' ) ;
193193var content ;
194194program . arguments ( '[files...]' ) . action ( function ( files ) {
195195 content = files . map ( readFile ) . join ( '' ) ;
@@ -262,7 +262,7 @@ function processDirectory(inputDir, outputDir, fileExt) {
262262 else if ( stat . isDirectory ( ) ) {
263263 processDirectory ( inputFile , outputFile , fileExt ) ;
264264 }
265- else if ( ! fileExt || path . extname ( file ) === '.' + fileExt ) {
265+ else if ( ! fileExt || ~ fileExt . indexOf ( path . extname ( file ) . slice ( 1 ) ) ) {
266266 mkdir ( outputDir , function ( ) {
267267 processFile ( inputFile , outputFile ) ;
268268 } ) ;
@@ -295,6 +295,9 @@ if (inputDir || outputDir) {
295295 else if ( ! outputDir ) {
296296 fatal ( 'You need to specify where to write the output files with the option --output-dir' ) ;
297297 }
298+ if ( fileExt ) {
299+ fileExt = fileExt . split ( ',' ) ;
300+ }
298301 processDirectory ( inputDir , outputDir , fileExt ) ;
299302}
300303// Minifying one or more files specified on the CMD line
0 commit comments