Skip to content
Myr

Prepare for 13.0.0-0 (#2292)

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

authored by John Gee · committed by GitHub · parent d355b52 · Browse files · 4 files+25 added−9 removed
This commit

State

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

Diff stats

4 files+25 added−9 removed

  • other:+25 added−9 removed

4 files+25 added−9 removed

modified:lib/command.js+1 added-1 removed
227 unmodified lines
228 * getErrHelpWidth()229 * // color support, currently only used with Help230 * getOutHasColors()231 * getErrHasColors()232 * stripColor() // used to remove ANSI escape codes if output does not have colours232 * stripColor() // used to remove ANSI escape codes if output does not have colors233 *234 * @param {object} [configuration] - configuration options235 * @return {(Command | object)} `this` command for chaining, or stored configuration236 */
2349 unmodified lines
modified:CHANGELOG.md+21 added-5 removed
1# Changelog23All notable changes to this project will be documented in this file.45The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),6and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).78<!-- markdownlint-disable MD024 -->9<!-- markdownlint-disable MD004 -->1011## [13.x] (date goes here)11## [13.0.0-1] (2024-12-08)1213### Added1415- style routines like `styleTitle()` to add color to help using `.configureHelp()` or Help subclass ([#2251])16- color related support in `.configureOutput()` for `getOutHasColors()`, `getErrHasColors()`, and `stripColor()` ([#2251])17- Help property for `minWidthToWrap` ([#2251])18- Help methods for `displayWidth()`, `boxWrap()`, `preformatted()` et al ([#2251])1920### Changed2115- *Breaking*: excess command-arguments cause an error by default22- *Breaking*: excess command-arguments cause an error by default, see migration tips ([#2223])23- *Breaking*: throw during Option construction for unsupported option flags, like multiple characters after single `-` ([#2270])24- TypeScript: include implicit `this` in parameters for action handler callback ([#2197])2526### Deleted2728- *Breaking*: `Help.wrap()` refactored into `formatItem()` and `boxWrap()` ([#2251])293031### Migration Tips3233**Excess command-arguments**3421It is now an error to pass more command-arguments than are expected.35It is now an error for the user to specify more command-arguments than are expected. (`allowExcessArguments` is now false by default.)3637Old code:3839```js
2 unmodified lines
42 console.log(program.args);43});44```4546Now shows an error:4748```console49$ node example.js a b c50error: too many arguments. Expected 0 arguments but got 3.51```
8 unmodified lines
60 console.log(args);61});62```6348Or you could suppress the error without changing the rest of the code:64Or you could suppress the error, useful for minimising changes in legacy code.6566```js67program.option('-p, --port', 'port number');68program.allowExcessArguments();
1414 unmodified lines
modified:package-lock.json+2 added-2 removed
1{2 "name": "commander",3 "version": "12.1.0",3 "version": "13.0.0-0",4 "lockfileVersion": 3,5 "requires": true,6 "packages": {7 "": {8 "name": "commander",9 "version": "12.1.0",9 "version": "13.0.0-0",10 "license": "MIT",11 "devDependencies": {12 "@eslint/js": "^9.4.0",13 "@types/jest": "^29.2.4",
5866 unmodified lines
modified:package.json+1 added-1 removed