Skip to content

Commit

Permalink
Fixed issue which caused .demand function not to work correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Ford authored and Alex Ford committed Feb 5, 2014
1 parent 05eb267 commit 6509e5e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ var wordwrap = require('./lib/wordwrap');

var inst = Argv(process.argv.slice(2));
Object.keys(inst).forEach(function (key) {
Argv[key] = typeof inst[key] == 'function'
? inst[key].bind(inst)
: inst[key];
if (key === 'argv') {
Object.defineProperty(Argv, 'argv', {
get: function() { return inst.argv; },
enumerable: true,
});
}
else {
Argv[key] = typeof inst[key] == 'function'
? inst[key].bind(inst)
: inst[key];
}
});

var exports = module.exports = Argv;
Expand Down

0 comments on commit 6509e5e

Please sign in to comment.