Skip to content

v6.1.0

Compare
Choose a tag to compare
@75lb 75lb released this 03 Nov 12:01
· 20 commits to master since this release

New feature since v6.0.2

In the list of option definitions passed to an optionList, the name property is no longer mandatory. Previously, the following example would have thrown validation errors due to the lack of name properties.

const commandLineUsage = require('command-line-usage')

const usage = commandLineUsage([
  {
    header: 'Options',
    optionList: [
      {
        description: 'Display this usage guide.',
        alias: 'h',
        type: Boolean
      },
      {
        description: 'Timeout value in ms.',
        alias: 't',
        type: Number,
        typeLabel: '{underline ms}'
      }
    ]
  }
])

console.log(usage)

Now, it returns the following output.


Options

  -h      Display this usage guide.
  -t ms   Timeout value in ms.