Skip to content

Commit

Permalink
Use minimist for argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
bthesorceror committed Feb 15, 2016
1 parent 02ee0a3 commit f9e6fe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions index.js
@@ -1,5 +1,7 @@
'use strict';

const minimist = require('minimist');

const help = {
command: 'help',
hidden: true,
Expand Down Expand Up @@ -89,8 +91,9 @@ class Fredrick {

if (!plugin) return;

args = args.slice(1);
plugin.func(this, args);
var options = minimist(args.slice(1));

plugin.func(this, options._, options);
}

findPlugin(command) {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -12,5 +12,7 @@
"sinon": "^1.17.3",
"tape": "^4.4.0"
},
"dependencies": {}
"dependencies": {
"minimist": "^1.2.0"
}
}

0 comments on commit f9e6fe4

Please sign in to comment.