diff --git a/src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt b/src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt index 91b1a8326f..dafb0cfd4c 100644 --- a/src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt +++ b/src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt @@ -205,7 +205,6 @@ System.CommandLine .ctor(System.String[] aliases, Func parseArgument, System.Boolean isDefault = False, System.String description = null) .ctor(System.String name, Func defaultValueFactory, System.String description = null) .ctor(System.String[] aliases, Func defaultValueFactory, System.String description = null) - public ArgumentArity Arity { get; set; } public static class OptionExtensions public static TOption AddCompletions(this TOption option, System.String[] values) public static TOption AddCompletions(this TOption option, System.Func> complete) diff --git a/src/System.CommandLine/Option.cs b/src/System.CommandLine/Option.cs index 7ff0f39200..8f24e496d3 100644 --- a/src/System.CommandLine/Option.cs +++ b/src/System.CommandLine/Option.cs @@ -83,7 +83,7 @@ public string? ArgumentHelpName /// /// Gets or sets the arity of the option. /// - public virtual ArgumentArity Arity + public ArgumentArity Arity { get => Argument.Arity; set => Argument.Arity = value; diff --git a/src/System.CommandLine/Option{T}.cs b/src/System.CommandLine/Option{T}.cs index 0a1f182caa..a0be08a9e8 100644 --- a/src/System.CommandLine/Option{T}.cs +++ b/src/System.CommandLine/Option{T}.cs @@ -60,12 +60,5 @@ public Option( : base(aliases, description, new Argument(defaultValueFactory ?? throw new ArgumentNullException(nameof(defaultValueFactory)))) { } - - /// - public override ArgumentArity Arity - { - get => base.Arity; - set => Argument.Arity = value; - } } } \ No newline at end of file