Error on unsupported flags for individual CLI commands by mixelburg · Pull Request #1889 · changesets/changesets
Fixes #1827
Currently the CLI silently ignores any flag it doesn't recognise and proceeds to run the command. This can lead to confusing behaviour — e.g. a typo in --otp silently results in publishing without an OTP.
This PR adds a warning printed via @changesets/logger whenever mri surfaces a parsed flag that isn't in the known set:
$ changeset publish --otpp 123456
🦋 warn Unknown flag: --otpp
Multiple unknown flags are collected and shown together:
$ changeset add --emptty --opeen
🦋 warn Unknown flags: --emptty, --opeen
The known set includes all declared boolean/string flags, their alias canonical names, the deprecated v1 flags (updateChangelog, isPublic, skipCI, commit) that already have their own error path in run.ts, and the built-in help/version flags.