diff --git a/README.md b/README.md index c8b7113..1448d47 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,10 @@ Usage: sane [...directory] [--glob=] [--poll] [--watchman OPTIONS: --glob= - A single string glob pattern or an array of them. + A single string glob pattern or an array of them. + + --ignored= + A glob, regex, function, or array of any combination. --poll, -p Use polling mode. @@ -107,9 +110,9 @@ OPTIONS: Enables watching files/directories that start with a dot. --wait= - Duration, in seconds, that watching will be disabled - after running . Setting this option will - throttle calls to for the specified duration. + Duration, in seconds, that watching will be disabled + after running . Setting this option will + throttle calls to for the specified duration. ``` It will watch the given `directory` and run the given every time a file changes. @@ -118,6 +121,7 @@ It will watch the given `directory` and run the given every time a fil - `sane 'echo "A command ran"'` - `sane 'echo "A command ran"' --glob='**/*.css'` - `sane 'echo "A command ran"' site/assets/css --glob='**/*.css'` +- `sane 'echo "A command ran"' --glob='**/*.css' --ignored='**/ignore.css'` - `sane 'echo "A command ran"' --wait=3` - `sane 'echo "A command ran"' -p` diff --git a/src/cli.js b/src/cli.js index f06e9f9..125bd6d 100755 --- a/src/cli.js +++ b/src/cli.js @@ -8,7 +8,8 @@ var execshell = require('exec-sh'); if (argv._.length === 0) { var msg = 'Usage: sane [...directory] [--glob=] ' + - '[--poll] [--watchman] [--dot] [--wait=]'; + '[--ignored=] [--poll] [--watchman] [--dot] ' + + '[--wait=]'; console.error(msg); process.exit(); } @@ -19,6 +20,7 @@ var dir = argv._[1] || process.cwd(); var waitTime = Number(argv.wait || argv.w); var dot = argv.dot || argv.d; var glob = argv.glob || argv.g; +var ignored = argv.ignored || argv.i; var poll = argv.poll || argv.p; var watchman = argv.watchman || argv.w; @@ -28,6 +30,9 @@ if (dot) { if (glob) { opts.glob = glob; } +if (ignored) { + opts.ignored = ignored; +} if (poll) { opts.poll = true; }