Comparing version 1.7.0 to 1.7.1
# node-dashdash changelog | ||
## 1.7.1 | ||
- Support an option group *empty string* value: | ||
... | ||
{ group: '' }, | ||
... | ||
to render as a blank line in option help. This can help separate loosely | ||
related sets of options without resorting to a title for option groups. | ||
## 1.7.0 | ||
@@ -4,0 +16,0 @@ |
@@ -278,3 +278,3 @@ /** | ||
var o = this.options[i]; | ||
if (o.group) { | ||
if (o.group !== undefined && o.group !== null) { | ||
assert.optionalString(o.group, | ||
@@ -578,3 +578,3 @@ format('config.options.%d.group', i)); | ||
this.options.forEach(function (o) { | ||
if (o.group) { | ||
if (o.group !== undefined && o.group !== null) { | ||
// We deal with groups in the next pass | ||
@@ -622,6 +622,12 @@ lines.push(null); | ||
this.options.forEach(function (o, i) { | ||
if (o.group) { | ||
// Render the group heading with the heading-specific indent: | ||
lines[i] = (i === 0 ? '' : '\n') + headingIndent + | ||
o.group + ':'; | ||
if (o.group !== undefined && o.group !== null) { | ||
if (o.group === '') { | ||
// Support a empty string "group" to have a blank line between | ||
// sets of options. | ||
lines[i] = ''; | ||
} else { | ||
// Render the group heading with the heading-specific indent. | ||
lines[i] = (i === 0 ? '' : '\n') + headingIndent + | ||
o.group + ':'; | ||
} | ||
return; | ||
@@ -628,0 +634,0 @@ } |
{ | ||
"name": "dashdash", | ||
"description": "A light, featureful and explicit option parsing library.", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"author": "Trent Mick <trentm@gmail.com> (http://trentm.com)", | ||
@@ -6,0 +6,0 @@ "keywords": ["option", "parser", "parsing", "cli", "command", "args"], |
@@ -378,2 +378,6 @@ A light, featureful and explicit option parsing library for node.js. | ||
Note: You can use an empty string, `{group: ''}`, to get a blank line in help | ||
output between groups of options. | ||
# Help config | ||
@@ -380,0 +384,0 @@ |
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
133625
1973
502