Comparing version 0.2.2 to 0.2.3
@@ -12,4 +12,6 @@ #!/usr/bin/env node | ||
.alias('b', 'base') | ||
.describe('b', 'Numeric base to display the final output in.') | ||
.describe('b', 'Numeric base to display the number of lines in') | ||
.default('b', 10) | ||
.describe('x', 'Super-secret optional parameter which is secret') | ||
.default('x', '') | ||
.argv | ||
@@ -16,0 +18,0 @@ ; |
25
index.js
@@ -263,9 +263,4 @@ var path = require('path'); | ||
var prelude = ' ' + kswitch + spadding; | ||
var body = [ | ||
desc, | ||
var extra = [ | ||
type, | ||
wrap | ||
? '\n' + new Array(prelude.length + 3).join(' ') | ||
: null | ||
, | ||
demanded[key] | ||
@@ -275,3 +270,3 @@ ? '[required]' | ||
, | ||
defaults[key] | ||
defaults[key] !== undefined | ||
? '[default: ' + JSON.stringify(defaults[key]) + ']' | ||
@@ -282,2 +277,18 @@ : null | ||
var body = [ desc, extra ].filter(Boolean).join(' '); | ||
if (wrap) { | ||
var dlines = desc.split('\n'); | ||
var dlen = dlines.slice(-1)[0].length | ||
+ (dlines.length === 1 ? prelude.length : 0) | ||
body = desc + (dlen + extra.length > wrap - 2 | ||
? '\n' | ||
+ new Array(wrap - extra.length + 1).join(' ') | ||
+ extra | ||
: new Array(wrap - extra.length - dlen + 1).join(' ') | ||
+ extra | ||
); | ||
} | ||
help.push(prelude + body); | ||
@@ -284,0 +295,0 @@ }); |
{ | ||
"name" : "optimist", | ||
"version" : "0.2.2", | ||
"version" : "0.2.3", | ||
"description" : "Light-weight option parsing with an argv hash. No optstrings attached.", | ||
@@ -5,0 +5,0 @@ "main" : "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38357
1017