Skip to content

Handling name conflicts between a builtin and developer-specified command or type #339

@autonordev

Description

@autonordev

If two commands are registered with the same name, the last one registered replaces the original. But since we can't predict if users register default or custom commands last, it could lead to unintended overwriting of custom commands by default ones.

Originally posted by @wilyt1 in #327 (comment)

I think it's an accurate assumption that most people are registering built-in stuff first, but you know what they say about assumptions! Imo it risks introducing breaking changes, violating both semver and Cmdr's reputation for stability.

If there's a conflict between a built-in command or type and a developer-registered one, the developer one should take priority irrespective of which was registered later. For a conflict between two developer-registered commands, the one registered later should take priority (I believe this is the current behaviour.)

A warning should be emitted in either case so that way there's no surprises for the developer.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions