A simple, data-driven module for creating a usage guide.
MIT License
This release freshens up the codebase and dependency tree. There are no functional changes to the API or behaviour.
Published by 75lb almost 5 years ago
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.
Published by 75lb over 5 years ago
lazyMultiple
options. #22string
. #23There have been no changes to the public API of this module. If you are using node v8 or above, you can upgrade safely.
Published by 75lb over 6 years ago
{red this is red {bold this is bold-red}}
)optionList
table layout is now fully customisable by setting a tableOptions
object.
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}
.
Published by 75lb almost 8 years ago
Removed support for Node less than v4.0.0. Users of old versions of Node can continue to use the previous version of this module.
Published by 75lb over 8 years ago
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.