Skip to content
Myr

Add explicit breaking notes (#1006)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Add explicit breaking notes * Move fullstop

authored by John Gee · committed by GitHub · parent 5b1b2fe · Browse files · 1 file+27 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+27 added−4 removed

  • other:+27 added−4 removed

1 file+27 added−4 removed

modified:CHANGELOG.md+27 added-4 removed
1 unmodified line
2==============================34 * Add option to specify executable file name ([#999])5 * e.g. `.command('clone', 'clone description', { executableFile: 'myClone' })`6 * Change docs for `.command` to contrast action handler vs git-style executable. TypeScript now uses overloaded function. ([#938] [#990])6 * Change docs for `.command` to contrast action handler vs git-style executable. ([#938] [#990])7 * **Breaking** Change TypeScript to use overloaded function for `.command`. ([#938] [#990])8 * Change to use straight quotes around strings in error messages (like 'this' instead of `this') ([#915])9 * Add TypeScript "reference types" for node ([#974])10 * Add support for hyphen as an option argument in subcommands ([#697])11 * Add support for a short option flag and its value to be concatenated for action handler subcommands ([#599])
6 unmodified lines
18 * Add `.helpOption(flags, description)` routine to customise help flags and description ([#963])19 * e.g. `.helpOption('-e, --HELP', 'read more information')`20 * Fix behavior of --no-* options ([#795])21 * can now define both `--foo` and `--no-foo`21 * custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`)22 * default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false)22 * **Breaking** custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`)23 * **Breaking** default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false)24 * allow boolean default value, such as from environment ([#987])25 * Increment inspector port for spawned subcommands ([#991])26 * e.g. `node --inspect myCommand.js clone`26 2728Example Breaking Changes29------------------------3031The custom event for a negated option like `--no-foo` is `option:no-foo` (previously `option:foo`).3233```js34program35 .option('--no-foo')36 .on('option:no-foo', () => {37 console.log('removing foo');38 });39```4041When using TypeScript, adding a command does not allow an explicit `undefined` for an unwanted executable description (e.g42for a command with an action handler).4344```js45program46 .command('action1', undefined, { noHelp: true }) // No longer valid47 .command('action2', { noHelp: true }) // Correct48```4950 [#599]: https://github.com/tj/commander.js/issues/59951 [#611]: https://github.com/tj/commander.js/issues/61152 [#697]: https://github.com/tj/commander.js/issues/69753 [#795]: https://github.com/tj/commander.js/issues/795
417 unmodified lines