Releases: 75lb/command-line-usage
v7.0.0
This release freshens up the codebase and dependency tree. There are no functional changes to the API or behaviour.
Breaking changes since v6.1.3
- Dropped support for node versions less than v12.20.
Non-breaking changes
Non-functional changes
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.
v6.0.0
Breaking changes since v5.0.5
- Support for node versions less than v8 removed.
Bug fixes
- typeLabel now indicates an array for
lazyMultiple
options. #22 - typeLabel now defaults to a
string
. #23
Other improvements
- Upgraded dependency tree. Bundle size reduced by 33%.
- Moved all the examples to the wiki
- Increased test coverage.
Upgrade notes
There have been no changes to the public API of this module. If you are using node v8 or above, you can upgrade safely.
v5.0.0
Breaking changes since v4.1.0
- All inline ansi formatting is now handled by chalk template literal syntax. Chalk benefits:
- nested style support (e.g.
{red this is red {bold this is bold-red}}
) - 256 colours and Truecolour support
- actively maintained.
- See here for example usage.
- nested style support (e.g.
New features
- the
optionList
table layout is now fully customisable by setting atableOptions
object.
Upgrading
If your usage guide does not use inline ansi formatting you can upgrade from v4 to v5 without change. If your guide does use ansi formatting you will need to upgrade the syntax, for example [underline](some text)
becomes {underline some text}
.
v4.0.0
v3.0.0
Breaking changes since v2
The commandLineUsage()
API changed. Previously, the usage guide template was fixed and you supplied an object containing template data. Now it takes an array of arbitrary section objects. You have full control over the content, you can add a section for anything you like.