commander 2.20.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -4
- package/Readme.md +343 -159
- package/index.js +231 -122
- package/package.json +7 -7
- package/typings/index.d.ts +55 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). (Format adopted after v3.0.0.)
|
|
7
|
+
|
|
8
|
+
## [3.0.1] (2019-08-30)
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
* .name and .usage to README ([#1010])
|
|
13
|
+
* Table of Contents to README ([#1010])
|
|
14
|
+
* TypeScript definition for `executableFile` in CommandOptions ([#1028])
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
* consistently use `const` rather than `var` in README ([#1026])
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
* help for sub commands with custom executableFile ([#1018])
|
|
3
23
|
|
|
4
|
-
|
|
5
|
-
|
|
24
|
+
3.0.0 / 2019-08-08
|
|
25
|
+
=================
|
|
26
|
+
|
|
27
|
+
* Add option to specify executable file name ([#999])
|
|
28
|
+
* e.g. `.command('clone', 'clone description', { executableFile: 'myClone' })`
|
|
29
|
+
* Change docs for `.command` to contrast action handler vs git-style executable. ([#938] [#990])
|
|
30
|
+
* **Breaking** Change TypeScript to use overloaded function for `.command`. ([#938] [#990])
|
|
31
|
+
* Change to use straight quotes around strings in error messages (like 'this' instead of `this') ([#915])
|
|
32
|
+
* Add TypeScript "reference types" for node ([#974])
|
|
33
|
+
* Add support for hyphen as an option argument in subcommands ([#697])
|
|
34
|
+
* Add support for a short option flag and its value to be concatenated for action handler subcommands ([#599])
|
|
35
|
+
* e.g. `-p 80` can also be supplied as `-p80`
|
|
36
|
+
* Add executable arguments to spawn in win32, for git-style executables ([#611])
|
|
37
|
+
* e.g. `node --harmony myCommand.js clone`
|
|
38
|
+
* Add parent command as prefix of subcommand in help ([#980])
|
|
39
|
+
* Add optional custom description to `.version` ([#963])
|
|
40
|
+
* e.g. `program.version('0.0.1', '-v, --vers', 'output the current version')`
|
|
41
|
+
* Add `.helpOption(flags, description)` routine to customise help flags and description ([#963])
|
|
42
|
+
* e.g. `.helpOption('-e, --HELP', 'read more information')`
|
|
43
|
+
* Fix behavior of --no-* options ([#795])
|
|
44
|
+
* can now define both `--foo` and `--no-foo`
|
|
45
|
+
* **Breaking** custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`)
|
|
46
|
+
* **Breaking** default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false)
|
|
47
|
+
* allow boolean default value, such as from environment ([#987])
|
|
48
|
+
* Increment inspector port for spawned subcommands ([#991])
|
|
49
|
+
* e.g. `node --inspect myCommand.js clone`
|
|
50
|
+
|
|
51
|
+
Example Breaking Changes
|
|
52
|
+
------------------------
|
|
53
|
+
|
|
54
|
+
The custom event for a negated option like `--no-foo` is `option:no-foo` (previously `option:foo`).
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
program
|
|
58
|
+
.option('--no-foo')
|
|
59
|
+
.on('option:no-foo', () => {
|
|
60
|
+
console.log('removing foo');
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
When using TypeScript, adding a command does not allow an explicit `undefined` for an unwanted executable description (e.g
|
|
65
|
+
for a command with an action handler).
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
program
|
|
69
|
+
.command('action1', undefined, { noHelp: true }) // No longer valid
|
|
70
|
+
.command('action2', { noHelp: true }) // Correct
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
3.0.0-0 Prerelease / 2019-07-28
|
|
74
|
+
==============================
|
|
75
|
+
|
|
76
|
+
(Released as 3.0.0)
|
|
6
77
|
|
|
7
78
|
2.20.0 / 2019-04-02
|
|
8
79
|
==================
|
|
@@ -411,3 +482,24 @@
|
|
|
411
482
|
==================
|
|
412
483
|
|
|
413
484
|
* Initial release
|
|
485
|
+
|
|
486
|
+
[#599]: https://github.com/tj/commander.js/issues/599
|
|
487
|
+
[#611]: https://github.com/tj/commander.js/issues/611
|
|
488
|
+
[#697]: https://github.com/tj/commander.js/issues/697
|
|
489
|
+
[#795]: https://github.com/tj/commander.js/issues/795
|
|
490
|
+
[#915]: https://github.com/tj/commander.js/issues/915
|
|
491
|
+
[#938]: https://github.com/tj/commander.js/issues/938
|
|
492
|
+
[#963]: https://github.com/tj/commander.js/issues/963
|
|
493
|
+
[#974]: https://github.com/tj/commander.js/issues/974
|
|
494
|
+
[#980]: https://github.com/tj/commander.js/issues/980
|
|
495
|
+
[#987]: https://github.com/tj/commander.js/issues/987
|
|
496
|
+
[#990]: https://github.com/tj/commander.js/issues/990
|
|
497
|
+
[#991]: https://github.com/tj/commander.js/issues/991
|
|
498
|
+
[#999]: https://github.com/tj/commander.js/issues/999
|
|
499
|
+
[#1010]: https://github.com/tj/commander.js/pull/1010
|
|
500
|
+
[#1018]: https://github.com/tj/commander.js/pull/1018
|
|
501
|
+
[#1026]: https://github.com/tj/commander.js/pull/1026
|
|
502
|
+
[#1028]: https://github.com/tj/commander.js/pull/1028
|
|
503
|
+
|
|
504
|
+
[Unreleased]: https://github.com/tj/commander.js/compare/master...develop
|
|
505
|
+
[3.0.1]: https://github.com/tj/commander.js/compare/v3.0.0...v3.0.1
|