Skip to content

Commit

Permalink
feat(m): pass multiple modules to check using -m foo,bar,baz syntax, c…
Browse files Browse the repository at this point in the history
…loses #88
  • Loading branch information
bahmutov committed Aug 16, 2016
1 parent 3687099 commit af4a644
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"console.json": "0.2.1",
"console.table": "0.4.0",
"debug": "2.2.0",
"deps-ok": "1.0.3",
"deps-ok": "1.1.0",
"easy-table": "0.3.0",
"is-online": "5.0.0",
"lazy-ass": "1.1.0",
Expand Down
12 changes: 11 additions & 1 deletion src/cli-options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

var optimist = require('optimist');
var pkg = require('../package.json');
var la = require('lazy-ass');
var is = require('check-more-types');
var _ = require('lodash');

var info = pkg.name + ' - ' + pkg.description + '\n' +
' version: ' + pkg.version + '\n' +
Expand All @@ -20,7 +25,7 @@ var program = optimist
.options('module', {
string: true,
alias: 'm',
description: 'checks specific module, can include version name@version',
description: 'checks specific module(s), can include version name@version',
default: null
})
.option('latest', {
Expand Down Expand Up @@ -96,4 +101,9 @@ if (program.help || program.h) {
process.exit(0);
}

if (is.string(program.module)) {
program.module = program.module.split(',').map(_.trim);
la(is.array(program.module), 'expected list of modules', program.module);
}

module.exports = program;

0 comments on commit af4a644

Please sign in to comment.