Skip to content

Commit 294a829

Browse files
committed
Minor cleanup and update release notes
1 parent accdd6c commit 294a829

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Changelog
22

3-
[Unreleased changes](https://github.com/natemcmaster/CommandLineUtils/compare/v2.5.1...HEAD):
3+
[Unreleased changes](https://github.com/natemcmaster/CommandLineUtils/compare/v2.6.0...HEAD):
44

55
### Improvements
66

77
* [@AlexeyEvlampiev] - implement support for GUID command line options ([#333]) and any other type that TypeConverter supports ([#62])
88
* Disabled the pager for help text by default. To re-enable, set UsePagerForHelpText = true. ([#346])
9+
* [@vpkopylov] - Added support for using the 'builder API' with generic host ([#351])
910

1011
### Breaking changes
1112

@@ -23,6 +24,7 @@
2324
[#337]: https://github.com/natemcmaster/CommandLineUtils/issues/337
2425
[#333]: https://github.com/natemcmaster/CommandLineUtils/issues/333
2526
[#346]: https://github.com/natemcmaster/CommandLineUtils/issues/346
27+
[#351]: https://github.com/natemcmaster/CommandLineUtils/pull/351
2628

2729
## [v2.6.0](https://github.com/natemcmaster/CommandLineUtils/compare/v2.5.1...v2.6.0)
2830

src/Hosting.CommandLine/Internal/CommandLineService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public CommandLineService(ILogger<CommandLineService> logger, CommandLineState s
4444
_application.Conventions.AddConvention(convention);
4545

4646
}
47-
47+
4848
configure(_application);
4949
}
5050

src/Hosting.CommandLine/releasenotes.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<Project>
22
<PropertyGroup>
33
<PackageReleaseNotes Condition="$(VersionPrefix.StartsWith('3.0.'))">
4+
Features:
5+
* @vpkopylov - Added support for using the 'builder API' by calling .RunCommandLineApplicationAsync(args, app => { })
6+
See https://github.com/natemcmaster/CommandLineUtils/pull/351 for details.
7+
48
Changes:
59
* Dependency on Microsoft.Extensions.Hosting lowered to Microsoft.Extensions.Hosting.Abstractions.
610
You may need to add a direct reference to Microsoft.Extensions.Hosting if this is not already in your

test/Hosting.CommandLine.Tests/HostBuilderExtensionsBuilderAPITests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public async Task TestReturnCode()
2626
{
2727
var exitCode = await new HostBuilder()
2828
.ConfigureServices(collection => collection.AddSingleton<IConsole>(new TestConsole(_output)))
29-
.RunCommandLineApplicationAsync(new string[0], (app) => app.OnExecute(() => 42));
29+
.RunCommandLineApplicationAsync(new string[0], app => app.OnExecute(() => 42));
3030
Assert.Equal(42, exitCode);
3131
}
3232

@@ -39,7 +39,7 @@ public async Task TestConsoleInjection()
3939
console.SetupGet(c => c.Out).Returns(textWriter.Object);
4040
await new HostBuilder()
4141
.ConfigureServices(collection => collection.AddSingleton(console.Object))
42-
.RunCommandLineApplicationAsync(new string[0], (app) => app.OnExecute(() => app.Out.WriteLine("42")));
42+
.RunCommandLineApplicationAsync(new string[0], app => app.OnExecute(() => app.Out.WriteLine("42")));
4343
Mock.Verify(console, textWriter);
4444
}
4545

@@ -57,7 +57,7 @@ public async Task TestConventionInjection()
5757
.ConfigureServices(collection => collection
5858
.AddSingleton<IConsole>(new TestConsole(_output))
5959
.AddSingleton(convention.Object))
60-
.RunCommandLineApplicationAsync(args, (app) => app.OnExecute(() =>
60+
.RunCommandLineApplicationAsync(args, app => app.OnExecute(() =>
6161
{
6262
remainingArgs = app.RemainingArguments.ToArray();
6363
}));
@@ -71,7 +71,7 @@ public async Task ItThrowsOnUnknownSubCommand()
7171
var ex = await Assert.ThrowsAsync<UnrecognizedCommandParsingException>(
7272
async () => await new HostBuilder()
7373
.ConfigureServices(collection => collection.AddSingleton<IConsole>(new TestConsole(_output)))
74-
.RunCommandLineApplicationAsync(new string[] { "return41" }, (app) =>
74+
.RunCommandLineApplicationAsync(new string[] { "return41" }, app =>
7575
{
7676
app.Command("return42", (cmd => cmd.OnExecute(() => 42)));
7777
}));
@@ -84,7 +84,7 @@ public async Task ItRethrowsThrownExceptions()
8484
var ex = await Assert.ThrowsAsync<InvalidOperationException>(
8585
() => new HostBuilder()
8686
.ConfigureServices(collection => collection.AddSingleton<IConsole>(new TestConsole(_output)))
87-
.RunCommandLineApplicationAsync(new string[0], (app) => app.OnExecute(() => throw new InvalidOperationException("A test"))));
87+
.RunCommandLineApplicationAsync(new string[0], app => app.OnExecute(() => throw new InvalidOperationException("A test"))));
8888
Assert.Equal("A test", ex.Message);
8989
}
9090

@@ -95,7 +95,7 @@ public async Task TestUsingServiceProvider()
9595

9696
await new HostBuilder()
9797
.ConfigureServices(collection => collection.AddSingleton<IConsole>(new TestConsole(_output)))
98-
.RunCommandLineApplicationAsync(new string[0], (app) => app.OnExecute(() =>
98+
.RunCommandLineApplicationAsync(new string[0], app => app.OnExecute(() =>
9999
{
100100
env = app.GetRequiredService<IHostEnvironment>();
101101
}));

0 commit comments

Comments
 (0)