Permalink
Browse files

[bin] Exposed --stoponerr option via CLI.

  • Loading branch information...
1 parent 4dbff81 commit 296f1b132569385d89d4104fba762891edbba187 @AvianFlu committed Nov 18, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 bin/ncp
View
@@ -20,13 +20,16 @@ function startsWith(str, prefix) {
var options = {};
args.forEach(function (arg) {
if (startsWith(arg, "--limit=")) {
- ncp.limit = Number(arg.split('=', 2)[1]);
+ options.limit = parseInt(arg.split('=', 2)[1], 10);
}
if (startsWith(arg, "--filter=")) {
options.filter = new RegExp(arg.split('=', 2)[1]);
}
+ if (startsWith(arg, "--stoponerr")) {
+ options.stopOnErr = true;
+ }
});
-options.stopOnError = true;
+
ncp.ncp(args[0], args[1], options, function (err) {
if (Array.isArray(err)) {
console.error('There were errors during the copy.');

0 comments on commit 296f1b1

Please sign in to comment.