Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit c4b3bf0

Browse files
committed
[fixes #11] use difference instead of without
1 parent 2485231 commit c4b3bf0

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

bin/m.docopt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Usage:
99
m d [<version>]
1010
m kill
1111
m ls
12-
m available [--stable --unstable --rc --all --pokemon]
12+
m available [--stable --unstable --rc --pokemon]
1313
m [<version> --url --branch=<branch>]
1414

1515
Examples:

bin/m.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ var commands = {
6666

6767
if(opts.pokemon){
6868
console.log(title + ' versions you haven\'t installed yet:');
69-
versions = _.without(versions, _.pluck(installed, 'version'));
70-
}
71-
else {
72-
console.log(title + ' versions you haven\'t installed yet:');
69+
versions = _.difference(versions, installed);
7370
}
7471
printVersions(versions, function(err){
7572
abortIfError(err);
@@ -125,13 +122,13 @@ var commands = {
125122
};
126123

127124
var opts = {
128-
version: argv['<v>'],
125+
version: argv['<version>'],
129126
branch: argv['--branch']
130127
};
131128

132129
var cmd = Object.keys(commands).filter(function(name){
133130
return argv[name] === true;
134-
})[0] || (argv['<v>'] ? 'use' : 'list');
131+
})[0] || (argv['<version>'] ? 'use' : 'list');
135132
debug('cmd is `%s` with opts `%j`', cmd, opts);
136133

137134
commands[cmd](opts);

0 commit comments

Comments
 (0)