Skip to content

v4.0.0

Compare
Choose a tag to compare
@shadowspawn shadowspawn released this 01 Nov 10:11
· 548 commits to master since this release

Added

  • automatically wrap and indent help descriptions for options and commands (#1051)
  • .exitOverride() allows override of calls to process.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
  • removed deprecated customFds option from call to child_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) ...