aboutsummaryrefslogtreecommitdiff
path: root/node_modules/nyc/lib/commands/instrument.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/nyc/lib/commands/instrument.js')
-rw-r--r--node_modules/nyc/lib/commands/instrument.js28
1 files changed, 25 insertions, 3 deletions
diff --git a/node_modules/nyc/lib/commands/instrument.js b/node_modules/nyc/lib/commands/instrument.js
index cf1e97461..b24c0bb56 100644
--- a/node_modules/nyc/lib/commands/instrument.js
+++ b/node_modules/nyc/lib/commands/instrument.js
@@ -31,11 +31,26 @@ exports.builder = function (yargs) {
type: 'boolean',
description: "should nyc's instrumenter produce source maps?"
})
+ .option('compact', {
+ default: true,
+ type: 'boolean',
+ description: 'should the output be compacted?'
+ })
+ .option('preserve-comments', {
+ default: true,
+ type: 'boolean',
+ description: 'should comments be preserved in the output?'
+ })
.option('instrument', {
default: true,
type: 'boolean',
description: 'should nyc handle instrumentation?'
})
+ .option('exit-on-error', {
+ default: false,
+ type: 'boolean',
+ description: 'should nyc exit when an instrumentation failure occurs?'
+ })
.example('$0 instrument ./lib ./output', 'instrument all .js files in ./lib with coverage and output in ./output')
}
@@ -50,11 +65,18 @@ exports.handler = function (argv) {
sourceMap: argv.sourceMap,
produceSourceMap: argv.produceSourceMap,
extension: argv.extension,
- require: argv.require
+ require: argv.require,
+ compact: argv.compact,
+ preserveComments: argv.preserveComments,
+ exitOnError: argv.exitOnError
})
nyc.instrumentAllFiles(argv.input, argv.output, function (err) {
- if (err) console.error(err.message)
- process.exit(1)
+ if (err) {
+ console.error(err.message)
+ process.exit(1)
+ } else {
+ process.exit(0)
+ }
})
}