Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds argument-arity parameter #16

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/System.CommandLine.Extensions/CommandOptionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ namespace System.CommandLine.Extensions
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public static partial class CommandOptionExtensions
{
public static CommandOption Option<T>(this CommandOption commandOption, string template, string? description = null)
public static CommandOption Option<T>(this CommandOption commandOption, string template, string? description = null, ArgumentArity argumentArity = default)
{
if (commandOption == null) throw new ArgumentNullException(nameof(commandOption));


return commandOption.Command.Option<T>(template, description);
return commandOption.Command.Option<T>(template, description, argumentArity);
}

public static void OnExecute(this CommandOption commandOption, Func<Task<int>> execute) => commandOption.Command.OnExecute(execute);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageVersion>2.1.0-beta4.22272.1</PackageVersion>
<PackageVersion>2.1.1-beta4.22272.1</PackageVersion>
<Authors>Matthias Friedrich</Authors>
<Description>A slim command configuration and execution layer similar to Microsoft.Extensions.CommandlineUtils.</Description>
<Copyright>2020 - 2024 by Matthias Friedrich</Copyright>
Expand All @@ -11,8 +11,8 @@
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<AssemblyVersion>2.1.1.0</AssemblyVersion>
<FileVersion>2.1.1.0</FileVersion>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

Expand Down