v6.1.0
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.