Skip to content

Commit b96e487

Browse files
authored
Update CommandLineUtils to 4.1.1 (#35)
1 parent f38670d commit b96e487

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

build/config.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- Dependency versions -->
33
<PropertyGroup>
44
<NuGetPackageVersion>6.12.1</NuGetPackageVersion>
5-
<CommandLineUtilsVersion>2.0.0</CommandLineUtilsVersion>
5+
<CommandLineUtilsVersion>4.1.1</CommandLineUtilsVersion>
66
<NuGetTestHelpersVersion>2.1.38</NuGetTestHelpersVersion>
77
<SleetVersion>5.2.12</SleetVersion>
88
<JsonVersion>13.0.3</JsonVersion>

src/NuGet.CatalogValidator/ValidateCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ internal static class ValidateCommand
2323
{
2424
public static void Register(CommandLineApplication cmdApp, HttpSource httpSource, ILogger consoleLog)
2525
{
26-
cmdApp.Command("validate", (cmd) => Run(cmd, httpSource, consoleLog), throwOnUnexpectedArg: true);
26+
cmdApp.Command("validate", cmd =>
27+
{
28+
cmd.UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.Throw;
29+
Run(cmd, httpSource, consoleLog);
30+
});
2731
}
2832

2933
private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogger consoleLog)
@@ -41,7 +45,7 @@ private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogg
4145

4246
cmd.HelpOption(Constants.HelpOption);
4347

44-
cmd.OnExecute(async () =>
48+
cmd.OnExecuteAsync(async (CancellationToken _) =>
4549
{
4650
var timer = new Stopwatch();
4751
timer.Start();

src/NuGetMirror/ListCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ internal static class ListCommand
1616
{
1717
public static void Register(CommandLineApplication cmdApp, HttpSource httpSource, ILogger log)
1818
{
19-
cmdApp.Command("list", (cmd) => Run(cmd, httpSource, log), throwOnUnexpectedArg: true);
19+
cmdApp.Command("list", cmd =>
20+
{
21+
cmd.UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.Throw;
22+
Run(cmd, httpSource, log);
23+
});
2024
}
2125

2226
private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogger log)
@@ -34,7 +38,7 @@ private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogg
3438

3539
cmd.HelpOption(Constants.HelpOption);
3640

37-
cmd.OnExecute(async () =>
41+
cmd.OnExecuteAsync(async (CancellationToken _) =>
3842
{
3943
try
4044
{

src/NuGetMirror/NupkgsCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ internal static class NupkgsCommand
2323
{
2424
public static void Register(CommandLineApplication cmdApp, HttpSource httpSource, ILogger consoleLog)
2525
{
26-
cmdApp.Command("nupkgs", (cmd) => Run(cmd, httpSource, consoleLog), throwOnUnexpectedArg: true);
26+
cmdApp.Command("nupkgs", cmd =>
27+
{
28+
cmd.UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.Throw;
29+
Run(cmd, httpSource, consoleLog);
30+
});
2731
}
2832

2933
private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogger consoleLog)
@@ -51,7 +55,7 @@ private static void Run(CommandLineApplication cmd, HttpSource httpSource, ILogg
5155

5256
cmd.HelpOption(Constants.HelpOption);
5357

54-
cmd.OnExecute(async () =>
58+
cmd.OnExecuteAsync(async (CancellationToken _) =>
5559
{
5660
var timer = new Stopwatch();
5761
timer.Start();

0 commit comments

Comments
 (0)