diff --git a/bin/wxss.js b/bin/wxss.js index 60f563d..258cb9d 100644 --- a/bin/wxss.js +++ b/bin/wxss.js @@ -8,18 +8,22 @@ const watch = require('../lib/watch.js') program .version(require('../package').version) - .usage('') + .usage(' [other-path...]') program - .arguments('') - .action(dir => { - fs.stat(dir, (err, stats) => { - if (err) console.log(chalk.yellow(err)) - else { - console.log(chalk.bgMagenta.white(' wxss is running... ')) - watch(dir) - } - }) + .arguments(' [other-path...]') + .action((frist, others) => { + const dirs = [frist, ...(others || [])]; + dirs.forEach(dir => { + fs.stat(dir, (err, stats) => { + if (err) console.log(chalk.yellow(err)) + else { + console.log(chalk.white(`watching ${dir} ... `)) + watch(dir) + } + }) + }); + console.log(chalk.bgMagenta.white(' wxss is running... ')) }) program @@ -29,4 +33,4 @@ program console.log() }) -program.parse(process.argv) \ No newline at end of file +program.parse(process.argv)