v4.0.0
Added
- automatically wrap and indent help descriptions for options and commands (#1051)
.exitOverride()
allows override of calls toprocess.exit
for additional error handling and to keep program running (#1040)- support for declaring required options with
.requiredOptions()
(#1071) - GitHub Actions support (#1027)
- translation links in README
Changed
- dev: switch tests from Sinon+Should to Jest with major rewrite of tests (#1035)
- call default subcommand even when there are unknown options (#1047)
- Breaking Commander is only officially supported on Node 8 and above, and requires Node 6 (#1053)
Fixed
- Breaking keep command object out of program.args when action handler called (#1048)
- also, action handler now passed array of unknown arguments
- complain about unknown options when program argument supplied and action handler (#1049)
- this changes parameters to
command:*
event to include unknown arguments
- this changes parameters to
- removed deprecated
customFds
option from call tochild_process.spawn
(#1052) - rework TypeScript declarations to bring all types into imported namespace (#1081)
Migration Tips
Testing for no arguments
If you were previously using code like:
if (!program.args.length) ...
a partial replacement is:
if (program.rawArgs.length < 3) ...