Skip to content

CLI silently ignores unknown flags and proceeds to execute commands #1827

@soberm

Description

@soberm

Bug Report

Current Behavior

The changesets CLI silently ignores unknown flags and proceeds to execute commands, which can lead to unintended actions.

Expected Behavior

The CLI should either:

  1. Show an error message for unknown flags
  2. Display help information when invalid flags are used
  3. At minimum, warn about unrecognized flags

Steps to Reproduce

  1. Run changeset publish --help (non-existent flag for this subcommand)
  2. Observe that the command execute changeset publish normally instead of erroring

Example Output

$ changeset publish --help  
# Proceeds to publish instead of showing help

Impact

This behavior is dangerous because:

  • Users expect --help to show documentation
  • Users expect unknown flags to not be silently ignored
  • Silent flag ignoring can lead to accidental publishes

Environment

  • @changesets/cli version: 2.29.8

Suggested Fix

Add flag validation that errors on unknown flags, similar to how most CLI tools handle this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions