Skip to content

name collision behavior is inconsistent for commands, directives, and options added to the same parent #2223

Open
@jonsequitur

Description

@jonsequitur

Currently, certain naming collisions between symbols under a common parent command will result in a parser configuration whose behavior might not be correct during parsing (e.g. one symbol will always shadow the other) or might throw an exception during parsing.

  • Commands and directives having the same name will throw System.ArgumentException: An item with the same key has already been added. even though this will not result in a misbehaving parser, since at parse time the actual directive tokens are differentiated from commands by the presence of surround [ and ] brackets. (Related: UseHost() - can't have subcommand "config" #2220)
    • A command with brackets in its name ("[command]") could be shadowed by a directive named command.
  • Commands and options with matching names or aliases will not currently result in an exception during parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-APIbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions