Skip to content

Option attribute doesn't support property overrides #454

@d1820

Description

@d1820

Describe the bug
If a property is marked as virtual and in a base class with the options attribute applied. When an override of that property is the implemented the option attribute complains for duplicate names.

To Reproduce

Base class

[Option(CommandOptionType.SingleValue, LongName = "folder", ShortName = "f", Description = "The folder to execute actions in. This could be where to read from or where to output to")]
        public virtual string WorkingFolder { get; set; }

Override Class

[Option(CommandOptionType.SingleValue, LongName = "folder", ShortName = "f", Description = "Override Description")]
        public override string WorkingFolder { get; set; }

Expected behavior
The option attribute of the override should be applied.

Error

Ambiguous option name. Both CLI.CliBase.WorkingFolder and CLI.Infra.PullCmd.WorkingFolder produce a CommandOption with the name 'f'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclosed-staleThis issue is closed because it went stale and there was no action planned. It can be reopened.help wantedWe would be willing to take a well-written PR to help fix this.stale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions