Skip to content

Commit

Permalink
Improve handing of --exclude CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
th0r committed May 15, 2018
1 parent 416a2f0 commit 78d00dd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/bin/analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const program = commander
'-e, --exclude <regexp>',
'Assets that should be excluded from the report.' +
br('Can be specified multiple times.'),
array,
[]
array()
)
.option(
'-l, --log-level <level>',
Expand Down Expand Up @@ -135,7 +134,10 @@ function br(str) {
return `\n${_.repeat(' ', 28)}${str}`;
}

function array(val, arr) {
arr.push(val);
return arr;
function array() {
const arr = [];
return (val) => {
arr.push(val);
return arr;
};
}

0 comments on commit 78d00dd

Please sign in to comment.