fix(cli): respond to `--help` on all subcommands by mixelburg · Pull Request #1873 · changesets/changesets

Problem

Running changeset <command> --help (e.g. changeset version --help) would silently execute the command instead of printing usage. The check parsed.help && args.length === 1 meant --help was only honoured when it was the sole argument.

This is especially harmful for commands that modify data (version, publish).

Fix

  • Removed the args.length === 1 guard so --help always exits early.
  • Added a COMMAND_HELP map: when a known subcommand is passed alongside --help, its specific usage line is printed; otherwise the full general help is shown.

Fixes #1823