Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Commit

Permalink
refacto(cli): update options
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Oct 31, 2015
1 parent 01a1a33 commit fb4dea9
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,28 @@ nomnom.command('cover')
metavar: '<path-to-config>',
help: 'the configuration file to use, defaults to .istanbul.yml'
})
.option('default-excludes', {
default: true,
flag: true,
help: 'apply default excludes [ **/node_modules/**, **/test/**, **/tests/** ]'
})
.option('excludes', {
abbr: 'x',
default: [],
help: 'one or more fileset patterns e.g. "**/vendor/**"',
list: true,
metavar: '<exclude-pattern>'
})
.option('report', {
default: 'lcv',
metavar: '<format>',
list: true,
help: `report format, defaults to ['lcv']`
help: 'report format'
})
.option('root', {
default: '.',

This comment has been minimized.

Copy link
@aukevanleeuwen

aukevanleeuwen Nov 3, 2015

@douglasduteil : now that you've specified this default here, you cannot specify it anymore in the configuration file .istanbul.yml, since the value there would always be overriden with . when resolving the configuration. Not a big deal since I can specify --root=some/path, but maybe not what you intended.

This comment has been minimized.

Copy link
@aukevanleeuwen

aukevanleeuwen Nov 3, 2015

Ah I see #84 has been opened now.

metavar: '<path>',
help: 'the root path to look for files to instrument, defaults to .'
help: 'the root path to look for files to instrument'
})
.option('include', {
default: ['**/*.js'],
Expand All @@ -54,8 +67,9 @@ nomnom.command('cover')
help: 'verbose mode'
})
.option('include-all-sources', {
default: false,
flag: true,
help: 'include-all-sources'
help: 'instrument all unused sources after running tests'
})

.callback(opts => {
Expand Down Expand Up @@ -122,14 +136,16 @@ function coverCmd(opts) {
////

function overrideConfigWith(opts){

console.dir(opts, {colors: true})
let overrides = {
verbose: opts.verbose,
instrumentation: {
root: opts.root,
'default-excludes': opts['default-excludes'],
excludes: opts.x,
excludes: opts.excludes,
'include-all-sources': opts['include-all-sources'],
// preload-sources is deprecated
// TODO(douglasduteil): remove this option
'preload-sources': opts['preload-sources']
},
reporting: {
Expand Down

0 comments on commit fb4dea9

Please sign in to comment.