Skip to content

Commit 11118a6

Browse files
Bump System.CommandLine and System.Text.Json (#554)
1 parent 8f77105 commit 11118a6

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

XmlDocConflictResolver/Program.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,37 @@ class Program
55
{
66
static async Task<int> Main(string[] args)
77
{
8-
var ixmlOption = new Option<DirectoryInfo?>(
9-
name: "--ixml",
10-
description: "The path to the IntelliSense XML files generated by the compiler.")
11-
{ IsRequired = true };
8+
var ixmlOption = new Option<DirectoryInfo?>("--isenseDir")
9+
{
10+
Required = true,
11+
Description = "The path to the IntelliSense XML files generated by the compiler."
12+
};
1213

13-
var ecmaxmlOption = new Option<DirectoryInfo?>(
14-
name: "--ecmaxml",
15-
description: "The path to the ECMAXML files from the docs repo.")
16-
{ IsRequired = true };
14+
var ecmaxmlOption = new Option<DirectoryInfo?>("--ecmaxmlDir")
15+
{
16+
Required = true,
17+
Description = "The path to the ECMAXML files from the docs repo."
18+
};
1719

1820
var rootCommand = new RootCommand("IntelliSense XML <-> ECMAXML doc comment resolver app");
19-
rootCommand.AddOption(ixmlOption);
20-
rootCommand.AddOption(ecmaxmlOption);
21+
rootCommand.Options.Add(ixmlOption);
22+
rootCommand.Options.Add(ecmaxmlOption);
2123

22-
rootCommand.SetHandler((ixmlDir, ecmaxmlDir) =>
24+
rootCommand.SetAction(parseResult =>
2325
{
24-
MergeAndAnnotate(ixmlDir!, ecmaxmlDir!);
25-
},
26-
ixmlOption, ecmaxmlOption);
26+
DirectoryInfo intelliSenseDir = parseResult.GetValue<DirectoryInfo>("--isenseDir");
27+
DirectoryInfo ecmaxmlDir = parseResult.GetValue<DirectoryInfo>("--ecmaxmlDir");
28+
29+
MergeAndAnnotate(intelliSenseDir, ecmaxmlDir);
30+
});
2731

28-
return await rootCommand.InvokeAsync(args);
32+
return rootCommand.Parse(args).Invoke();
2933
}
3034

3135
static void MergeAndAnnotate(DirectoryInfo iXmlDir, DirectoryInfo ecmaxmlDir)
3236
{
3337
// Load all files
34-
// For each member in the IntelliSense XML, see if there's non-emtpy text in ECMAXML.
38+
// For each member in the IntelliSense XML, see if there's non-empty text in ECMAXML.
3539
// If so, save both versions of the text in the IntelliSense XML object.
3640
// After the for each loop, write new XML for any namespaces
3741
// that have members with more than one copy of summary/returns/param etc.
@@ -43,4 +47,4 @@ static void MergeAndAnnotate(DirectoryInfo iXmlDir, DirectoryInfo ecmaxmlDir)
4347
checker.AddConflictMarkers();
4448
checker.CleanUpFiles();
4549
}
46-
}
50+
}

XmlDocConflictResolver/XmlDocConflictResolver.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Cake.Powershell" Version="4.0.0" />
12-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
13-
<PackageReference Include="System.Text.Json" Version="9.0.6" />
12+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta6.25358.103" />
13+
<PackageReference Include="System.Text.Json" Version="9.0.7" />
1414
</ItemGroup>
1515

1616
</Project>

0 commit comments

Comments
 (0)