Skip to content

Releases: 75lb/command-line-usage

v7.0.0

05 Mar 12:22
Compare
Choose a tag to compare

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

  • Updated chalk so command-line-usage now works in deno. Fixes #40.

Non-functional changes

  • Updated codebase (including all examples) from CommonJS to ES Modules. A CJS build is included for backwards compatibility.
  • Added an example showing how to use table-layout in a content section, also updated the wiki docs

v6.1.0

03 Nov 12:01
Compare
Choose a tag to compare

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

30 Jun 17:33
Compare
Choose a tag to compare

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

09 Mar 12:25
Compare
Choose a tag to compare

Breaking changes since v4.1.0

New features

  • the optionList table layout is now fully customisable by setting a tableOptions 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

16 Jan 20:57
Compare
Choose a tag to compare

Breaking changes since v3.0.8

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.

v3.0.0

31 May 08:46
Compare
Choose a tag to compare

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.