Skip to content

v3.0.0

Compare
Choose a tag to compare
@75lb 75lb released this 29 May 13:32
· 159 commits to master since this release

Breaking changes since v2

The command-line-usage library evolved recently, it is now more flexible with a new API. As its API changed i found myself needing to update the .getUsage() method of this library, causing a breaking change. Rather than update this library each time command-line-usage changes, i separated them completely. Therefore, the .getUsage() method has been removed and the .parse() method is now exported directly.

So, the API has changed from

const commandLineArgs = require('command-line-args')
const cli = commandLineArgs([ { name: 'version' } ])
const options = cli.parse()

to the more concise

const commandLineArgs = require('command-line-args')
const options = commandLineArgs([ { name: 'version' } ])

The data you previously passed to .getUsage() you should pass to command-line-usage v2, like so:

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

For details about command-line-usage, including the new v3, see the project page.