Skip to content

Inheritance and Options are broken #447

@peter-shinydocs

Description

@peter-shinydocs

Describe the bug

  • Somewhere between 2.4.4 and 2.5.0 something changed that breaks inheritance with the options.
  • Getting

System.InvalidOperationException : Ambiguous option name. Both Shinydocs.CognitiveToolkit.Tests.UI.CommandLine.Commands.BaseCommand.Test and Shinydocs.CognitiveToolkit.Tests.UI.CommandLine.Commands.DerivedCommand.Test produce a CommandOption with the name 't'.

To Reproduce
Steps to reproduce the behavior:

  1. Set up Classes
public abstract class BaseCommand
{
	
[Option(Description = "Example (Required)")]
	[Required]
	
public string? Test { get; set; }
}



[Command(Name = "CognitiveToolkit Test")]

public class DerivedCommand : BaseCommand
{
	
[Option(Description = "I actually want this description  (Required)")]
	[Required]
	
public new string? Test { get; set; }
}
  1. Run cli.Conventions.UseDefaultConventions();

Expected behavior
I get the description of the derived class (like it was in 2.4.4

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

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