Fix benchmarks

This commit is contained in:
Alexey Golub
2019-08-11 18:44:35 +03:00
parent b0d9626e74
commit 6a06cdc422
2 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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));
}