Skip to content

Commit cfdadc3

Browse files
adamsitnikjonsequitur
authored andcommitted
since Option defines Arity, Option<T> does not need to
1 parent 78ade26 commit cfdadc3

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ System.CommandLine
205205
.ctor(System.String[] aliases, Func<System.CommandLine.Parsing.ArgumentResult,T> parseArgument, System.Boolean isDefault = False, System.String description = null)
206206
.ctor(System.String name, Func<T> defaultValueFactory, System.String description = null)
207207
.ctor(System.String[] aliases, Func<T> defaultValueFactory, System.String description = null)
208-
public ArgumentArity Arity { get; set; }
209208
public static class OptionExtensions
210209
public static TOption AddCompletions<TOption>(this TOption option, System.String[] values)
211210
public static TOption AddCompletions<TOption>(this TOption option, System.Func<System.CommandLine.Completions.CompletionContext,System.Collections.Generic.IEnumerable<System.String>> complete)

src/System.CommandLine/Option.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public string? ArgumentHelpName
8383
/// <summary>
8484
/// Gets or sets the arity of the option.
8585
/// </summary>
86-
public virtual ArgumentArity Arity
86+
public ArgumentArity Arity
8787
{
8888
get => Argument.Arity;
8989
set => Argument.Arity = value;

src/System.CommandLine/Option{T}.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,5 @@ public Option(
6060
: base(aliases, description, new Argument<T>(defaultValueFactory ?? throw new ArgumentNullException(nameof(defaultValueFactory))))
6161
{
6262
}
63-
64-
/// <inheritdoc/>
65-
public override ArgumentArity Arity
66-
{
67-
get => base.Arity;
68-
set => Argument.Arity = value;
69-
}
7063
}
7164
}

0 commit comments

Comments
 (0)