Skip to content

Commit

Permalink
all tests passing using minimist
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 25, 2013
1 parent 76f1352 commit d37bfe0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function Argv (processArgs, cwd) {
var keys = Object.keys(
Object.keys(descriptions)
.concat(Object.keys(demanded))
.concat(Object.keys(defaults))
.concat(Object.keys(options.default))
.reduce(function (acc, key) {
if (key !== '_') acc[key] = true;
return acc;
Expand All @@ -198,7 +198,7 @@ function Argv (processArgs, cwd) {
}

var switches = keys.reduce(function (acc, key) {
acc[key] = [ key ].concat(aliases[key] || [])
acc[key] = [ key ].concat(options.alias[key] || [])
.map(function (sw) {
return (sw.length > 1 ? '--' : '-') + sw
})
Expand Down Expand Up @@ -235,8 +235,8 @@ function Argv (processArgs, cwd) {

var type = null;

if (flags.bools[key]) type = '[boolean]';
if (flags.strings[key]) type = '[string]';
if (options.boolean[key]) type = '[boolean]';
if (options.string[key]) type = '[string]';

if (!wrap && dpadding.length > 0) {
desc += dpadding;
Expand All @@ -249,8 +249,8 @@ function Argv (processArgs, cwd) {
? '[required]'
: null
,
defaults[key] !== undefined
? '[default: ' + JSON.stringify(defaults[key]) + ']'
options.default[key] !== undefined
? '[default: ' + JSON.stringify(options.default[key]) + ']'
: null
,
].filter(Boolean).join(' ');
Expand Down

0 comments on commit d37bfe0

Please sign in to comment.