Skip to content

Commit

Permalink
[api minor dist] Remove optimist dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Dec 2, 2011
1 parent 0353920 commit e1c9fa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 3 additions & 8 deletions lib/director/cli.js
@@ -1,7 +1,6 @@

var util = require('util'),
director = require('../director'),
optimist = require('optimist');
director = require('../director');

var Router = exports.Router = function (routes) {
director.Router.call(this, routes);
Expand Down Expand Up @@ -44,14 +43,10 @@ Router.prototype.dispatch = function (method, path, tty, callback) {
// algorithm will recognize it. This is because we always assume
// that the `path` begins with `this.delimiter`.
//
var argv = optimist(path.split(' ')).argv;
path = ' ' + argv._.join(' ');
var fns = this.traverse(method, path, this.routes, '');

if (!fns || fns.length === 0) {

if (typeof this.notfound === 'function') {
this.invoke([this.notfound], { params: argv, tty: tty, cmd: path }, callback);
this.invoke([this.notfound], { tty: tty, cmd: path }, callback);
}
else if (callback) {
callback(new Error('Could not find path: ' + path));
Expand All @@ -64,6 +59,6 @@ Router.prototype.dispatch = function (method, path, tty, callback) {
fns = fns.reverse();
}

this.invoke(fns, { params: argv, tty: tty, cmd: path }, callback);
this.invoke(fns, { tty: tty, cmd: path }, callback);
return true;
};
3 changes: 0 additions & 3 deletions package.json
Expand Up @@ -14,9 +14,6 @@
"url": "http://github.com/flatiron/director.git"
},
"keywords": ["URL", "router", "http", "cli", "flatiron", "client side"],
"dependencies": {
"optimist": "0.2.x"
},
"devDependencies": {
"codesurgeon": "0.2.x",
"colors": "0.5.x",
Expand Down

0 comments on commit e1c9fa8

Please sign in to comment.