Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort on ambiguous subcommand names #629

Closed
wants to merge 1 commit into from

Commits on Apr 4, 2024

  1. Abort on ambiguous subcommand names

    Currently it's possible to have two commands with the same _commandName
    by mixing a combination of the automatic command name generation based on
    the type name, and explicit use of `CommandConfiguration`'s commandName
    parameter. For example, if we edit the math examples `Add` command to
    have a commandName of "multiply" this is allowed currently:
    
    ```
    ./.build/debug/math multiply 2 3
    5
    ```
    
    The behavior today is whatever subcommand is registered in the tree first
    is what will resolve for that command. So, `Multiply` in this example is
    permanently shadowed.
    
    This change just makes sure there's no occurence of this happening in any
    level of the tree of potential subcommands, and if so we'll abort early.
    dcantah committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    241162e View commit details
    Browse the repository at this point in the history