This commit is contained in:
Tyrrrz
2021-12-08 23:43:35 +02:00
parent 9990387cfa
commit 2feeb21270
132 changed files with 8021 additions and 8154 deletions

View File

@@ -1,30 +1,29 @@
using BenchmarkDotNet.Attributes;
using CommandLine;
namespace CliFx.Benchmarks
namespace CliFx.Benchmarks;
public partial class Benchmarks
{
public partial class Benchmarks
public class CommandLineParserCommand
{
public class CommandLineParserCommand
[Option('s', "str")]
public string? StrOption { get; set; }
[Option('i', "int")]
public int IntOption { get; set; }
[Option('b', "bool")]
public bool BoolOption { get; set; }
public void Execute()
{
[Option('s', "str")]
public string? StrOption { get; set; }
[Option('i', "int")]
public int IntOption { get; set; }
[Option('b', "bool")]
public bool BoolOption { get; set; }
public void Execute()
{
}
}
[Benchmark(Description = "CommandLineParser")]
public void ExecuteWithCommandLineParser() =>
new Parser()
.ParseArguments(Arguments, typeof(CommandLineParserCommand))
.WithParsed<CommandLineParserCommand>(c => c.Execute());
}
[Benchmark(Description = "CommandLineParser")]
public void ExecuteWithCommandLineParser() =>
new Parser()
.ParseArguments(Arguments, typeof(CommandLineParserCommand))
.WithParsed<CommandLineParserCommand>(c => c.Execute());
}