@@ -5,33 +5,37 @@ class Program
5
5
{
6
6
static async Task < int > Main ( string [ ] args )
7
7
{
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
+ } ;
12
13
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
+ } ;
17
19
18
20
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 ) ;
21
23
22
- rootCommand . SetHandler ( ( ixmlDir , ecmaxmlDir ) =>
24
+ rootCommand . SetAction ( parseResult =>
23
25
{
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
+ } ) ;
27
31
28
- return await rootCommand . InvokeAsync ( args ) ;
32
+ return rootCommand . Parse ( args ) . Invoke ( ) ;
29
33
}
30
34
31
35
static void MergeAndAnnotate ( DirectoryInfo iXmlDir , DirectoryInfo ecmaxmlDir )
32
36
{
33
37
// 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.
35
39
// If so, save both versions of the text in the IntelliSense XML object.
36
40
// After the for each loop, write new XML for any namespaces
37
41
// that have members with more than one copy of summary/returns/param etc.
@@ -43,4 +47,4 @@ static void MergeAndAnnotate(DirectoryInfo iXmlDir, DirectoryInfo ecmaxmlDir)
43
47
checker . AddConflictMarkers ( ) ;
44
48
checker . CleanUpFiles ( ) ;
45
49
}
46
- }
50
+ }
0 commit comments