Skip to content

Commit 1e5b806

Browse files
committed
Upgrade to Spectre.Console.Cli 0.53.0
1 parent 26813df commit 1e5b806

File tree

6 files changed

+41
-28
lines changed

6 files changed

+41
-28
lines changed

src/nugraph/CancelableCommand.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/nugraph/GraphCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ internal sealed partial class FileOrPackage : OneOfBase<FileSystemInfo, PackageI
2828
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global", Justification = "Instantiated by Spectre.Console.Cli through reflection")]
2929
[SuppressMessage("Performance", "CA1812:Avoid uninstantiated internal classes", Justification = "Instantiated by Spectre.Console.Cli through reflection")]
3030
[Description("Generates dependency graphs for .NET projects and NuGet packages.")]
31-
internal sealed class GraphCommand(ProgramEnvironment environment, CancellationToken cancellationToken) : CancelableCommand<GraphCommandSettings>(cancellationToken)
31+
internal sealed class GraphCommand(ProgramEnvironment environment) : AsyncCommand<GraphCommandSettings>
3232
{
33-
protected override async Task<int> ExecuteAsync(CommandContext commandContext, GraphCommandSettings settings, CancellationToken cancellationToken)
33+
public override async Task<int> ExecuteAsync(CommandContext commandContext, GraphCommandSettings settings, CancellationToken cancellationToken)
3434
{
3535
var stdOut = environment.StdOut;
3636
var console = environment.ConsoleErr;

src/nugraph/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ public async Task<int> RunAsync(params string[] args)
4848
config.SetApplicationVersion(typeof(Program).Assembly.GetVersion());
4949
config.ConfigureConsole(environment.ConsoleOut);
5050
config.Settings.Registrar.RegisterInstance(environment);
51-
config.Settings.Registrar.RegisterInstance(cancellationTokenSource.Token);
5251
config.SetExceptionHandler((exception, _) =>
5352
{
5453
var consoleErr = environment.ConsoleErr;
5554
switch (exception)
5655
{
5756
case OperationCanceledException when cancellationTokenSource.IsCancellationRequested:
58-
return 130; // https://github.com/spectreconsole/spectre.console/issues/701#issuecomment-2342979700
57+
return config.Settings.CancellationExitCode;
5958
case Exception when ExceptionTransformer.GetError(exception) is { } error:
6059
consoleErr.Write(error.Pretty);
6160
if (error.ExitCode.HasValue)
@@ -85,6 +84,6 @@ public async Task<int> RunAsync(params string[] args)
8584
});
8685
});
8786

88-
return await app.RunAsync(args);
87+
return await app.RunAsync(args, cancellationTokenSource.Token);
8988
}
9089
}

src/nugraph/nugraph.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<PackageReference Include="OneOf" Version="3.0.271" />
5555
<PackageReference Include="OneOf.SourceGenerator" Version="3.0.271" PrivateAssets="all" />
5656
<PackageReference Include="Spectre.Console.Analyzer" Version="1.0.0" PrivateAssets="all" />
57-
<PackageReference Include="Spectre.Console.Cli" Version="0.51.1" />
57+
<PackageReference Include="Spectre.Console.Cli" Version="0.53.0" />
5858
</ItemGroup>
5959

6060
<ItemGroup>

src/nugraph/packages.lock.json

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@
7575
},
7676
"Spectre.Console.Cli": {
7777
"type": "Direct",
78-
"requested": "[0.51.1, )",
79-
"resolved": "0.51.1",
80-
"contentHash": "LqJjjug5f8ipFFzhwBaQHMXt8+uuJAxu3dsyAxF+Jyva9yHW0P3iP6s1NpwVqt0Yk11n6/f9qipyiEn0zBKBiQ==",
78+
"requested": "[0.53.0, )",
79+
"resolved": "0.53.0",
80+
"contentHash": "9m26DC9IGMjA+qjlEtO2BsukmbymNvrXUtu5sh3sc2uCKHdawqVMwcnmiKO/bKKG0pHIzI1O/H2Qr/m2uh+rQw==",
8181
"dependencies": {
82-
"Spectre.Console": "0.51.1"
82+
"OpenCli.Sources": "0.5.0",
83+
"Spectre.Console": "0.53.0"
8384
}
8485
},
8586
"Microsoft.Build.Framework": {
@@ -92,11 +93,31 @@
9293
"resolved": "17.11.31",
9394
"contentHash": "eYFod+GPNjpcjviyz2xjNIkNuj4aowrucHGQZxs9xWfJmbv8evo/Nud56Kb38x2prbKnCEfZhbhIBc2e/qlZAA=="
9495
},
96+
"Namotion.Reflection": {
97+
"type": "Transitive",
98+
"resolved": "3.4.2",
99+
"contentHash": "ZHrvPdAg7zV78iOTiH9ua+34rBfn4iH6Bjfo2bzUHOGD3KkjGUvqxBFy+v9p6qwV+GEeYWl4NOqXH8tVcZOMpw=="
100+
},
95101
"Newtonsoft.Json": {
96102
"type": "Transitive",
97103
"resolved": "13.0.3",
98104
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
99105
},
106+
"NJsonSchema": {
107+
"type": "Transitive",
108+
"resolved": "11.4.0",
109+
"contentHash": "0q6mr6eJk/D4jPFKyRwAPauedZK60yFE5rjA3+aqCdQm9kGE9J8xygRrLfk0Ms8wBviWbLlaZYzqAteG3b6Yag==",
110+
"dependencies": {
111+
"NJsonSchema.Annotations": "11.4.0",
112+
"Namotion.Reflection": "3.4.2",
113+
"Newtonsoft.Json": "13.0.3"
114+
}
115+
},
116+
"NJsonSchema.Annotations": {
117+
"type": "Transitive",
118+
"resolved": "11.4.0",
119+
"contentHash": "fKAGyIU9s18e9GAdNbEr2PmZdpBqb1RdAr2+EHHrdkSZNoYtwFcmN6syJaxYxeEFegoLbC3e+EU5eb7Tt1ph3Q=="
120+
},
100121
"NuGet.Common": {
101122
"type": "Transitive",
102123
"resolved": "6.14.0",
@@ -164,10 +185,18 @@
164185
"resolved": "6.14.0",
165186
"contentHash": "4v4blkhCv8mpKtfx+z0G/X0daVCzdIaHSC51GkUspugi5JIMn2Bo8xm5PdZYF0U68gOBfz/+aPWMnpRd85Jbow=="
166187
},
188+
"OpenCli.Sources": {
189+
"type": "Transitive",
190+
"resolved": "0.5.0",
191+
"contentHash": "5FgwoxpZy9Qy7MsKHb2hZBTWXEvg7JCPuNnaqsn2g0/X9oWQVThYQ1nND1xJrq8P1aw+Gh8sirV1HbefeqSalw==",
192+
"dependencies": {
193+
"NJsonSchema": "11.4.0"
194+
}
195+
},
167196
"Spectre.Console": {
168197
"type": "Transitive",
169-
"resolved": "0.51.1",
170-
"contentHash": "84xNywgnaG8XgOypnZAL+EZUbhCGE0umj7fuMrSI6esdE74HYHRoeBioeMUJXPiCt7iBDKHLwiBcg0IliYIIxA=="
198+
"resolved": "0.53.0",
199+
"contentHash": "m2iv8Egfywp7FaNLKCmCFHbSf36D4ctzZKvlAK9NXMyGLh6L+CnrZWK8o+LOYsoAS1jtoHn0W1BT0W8vuq/FUw=="
171200
},
172201
"System.Collections.Immutable": {
173202
"type": "Transitive",

tests/nugraph.Tests/nugraph.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ItemGroup>
2020
<PackageReference Include="AwesomeAssertions" Version="9.2.0" />
2121
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.8.4" />
22-
<PackageReference Include="Spectre.Console.Testing" Version="0.51.1" />
22+
<PackageReference Include="Spectre.Console.Testing" Version="0.53.0" />
2323
<PackageReference Include="TUnit.Engine" Version="0.67.10" />
2424
</ItemGroup>
2525

0 commit comments

Comments
 (0)