mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Fix benchmarks
This commit is contained in:
@@ -11,7 +11,7 @@ namespace CliFx.Benchmarks
|
||||
private static readonly string[] Arguments = { "--str", "hello world", "-i", "13", "-b" };
|
||||
|
||||
[Benchmark(Description = "CliFx", Baseline = true)]
|
||||
public Task<int> ExecuteWithCliFx() => new CliApplication(new[] {typeof(CliFxCommand)}).RunAsync(Arguments);
|
||||
public Task<int> ExecuteWithCliFx() => new CliApplicationBuilder().WithCommand(typeof(CliFxCommand)).Build().RunAsync(Arguments);
|
||||
|
||||
[Benchmark(Description = "System.CommandLine")]
|
||||
public Task<int> ExecuteWithSystemCommandLine() => new SystemCommandLineCommand().ExecuteAsync(Arguments);
|
||||
|
||||
@@ -78,10 +78,10 @@ namespace CliFx
|
||||
var commandFactory = _commandFactory ?? new CommandFactory();
|
||||
|
||||
// Project parameters to expected types
|
||||
var applicationMetadata = new ApplicationMetadata(title, executableName, versionText);
|
||||
var metadata = new ApplicationMetadata(title, executableName, versionText);
|
||||
var commandTypes = _commandTypes.ToArray();
|
||||
|
||||
return new CliApplication(applicationMetadata, commandTypes,
|
||||
return new CliApplication(metadata, commandTypes,
|
||||
console, new CommandInputParser(), new CommandSchemaResolver(),
|
||||
commandFactory, new CommandInitializer(), new CommandHelpTextRenderer(console));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user