command-line-usage
Advanced tools
Comparing version 6.0.2 to 6.1.0
const Section = require('../section') | ||
const Table = require('table-layout') | ||
const chalkFormat = require('../chalk-format') | ||
const chalk = require('../chalk-format') | ||
const t = require('typical') | ||
@@ -21,8 +21,2 @@ const arrayify = require('array-back') | ||
/* All definitions must have a name */ | ||
const validNames = definitions.every(d => d.name) | ||
if (!validNames) { | ||
throw new Error('Every definition in the optionList must have a `name` property') | ||
} | ||
if (data.header) this.header(data.header) | ||
@@ -41,3 +35,3 @@ | ||
option: getOptionNames(def, data.reverseNameOrder), | ||
description: chalkFormat(def.description) | ||
description: chalk(def.description) | ||
} | ||
@@ -66,14 +60,21 @@ }) | ||
} | ||
// console.error(require('util').inspect(definition.typeLabel || type, { depth: 6, colors: true })) | ||
type = chalkFormat(definition.typeLabel || type) | ||
type = chalk(definition.typeLabel || type) | ||
let result = '' | ||
if (definition.alias) { | ||
if (reverseNameOrder) { | ||
result = `${chalkFormat(`{bold --${definition.name}}`)}, ${chalkFormat(`{bold -${definition.alias}}`)} ${type}` | ||
if (definition.name) { | ||
if (reverseNameOrder) { | ||
result = chalk(`{bold --${definition.name}}, {bold -${definition.alias}} ${type}`) | ||
} else { | ||
result = chalk(`{bold -${definition.alias}}, {bold --${definition.name}} ${type}`) | ||
} | ||
} else { | ||
result = `${chalkFormat(`{bold -${definition.alias}}`)}, ${chalkFormat(`{bold --${definition.name}} ${type}`)}` | ||
if (reverseNameOrder) { | ||
result = chalk(`{bold -${definition.alias}} ${type}`) | ||
} else { | ||
result = chalk(`{bold -${definition.alias}} ${type}`) | ||
} | ||
} | ||
} else { | ||
result = `${chalkFormat(`{bold --${definition.name}}`)} ${type}` | ||
result = chalk(`{bold --${definition.name}} ${type}`) | ||
} | ||
@@ -80,0 +81,0 @@ return result |
{ | ||
"name": "command-line-usage", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "6.0.2", | ||
"version": "6.1.0", | ||
"description": "Generates command-line usage information", | ||
@@ -27,10 +27,10 @@ "repository": "https://github.com/75lb/command-line-usage.git", | ||
"dependencies": { | ||
"array-back": "^3.1.0", | ||
"array-back": "^4.0.0", | ||
"chalk": "^2.4.2", | ||
"table-layout": "^1.0.0", | ||
"typical": "^5.1.0" | ||
"typical": "^5.2.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.4", | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"coveralls": "^3.0.7", | ||
"jsdoc-to-markdown": "^5.0.2", | ||
"nyc": "^14.1.1", | ||
@@ -37,0 +37,0 @@ "test-runner": "^0.6.0" |
@@ -52,3 +52,3 @@ [![view on npm](http://img.shields.io/npm/v/command-line-usage.svg)](https://www.npmjs.org/package/command-line-usage) | ||
## More examples | ||
## Some examples | ||
@@ -116,3 +116,3 @@ ### Typical | ||
* [API Reference](https://github.com/75lb/command-line-usage/blob/master/doc/api.md) | ||
* [Examples](https://github.com/75lb/command-line-usage/wiki) | ||
* [The full list of examples](https://github.com/75lb/command-line-usage/wiki) | ||
@@ -119,0 +119,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
320
19315
- Removedarray-back@3.1.0(transitive)
Updatedarray-back@^4.0.0
Updatedtypical@^5.2.0