File tree Expand file tree Collapse file tree 1 file changed +20
-24
lines changed Expand file tree Collapse file tree 1 file changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -75,39 +75,35 @@ public static async Task<int> Main(string[] args)
7575
7676 bool cli = args is { } && args . Any ( ) ;
7777
78- if ( cli ) {
79- if ( args . Contains ( R2 . Arg_NoUI ) ) {
80- var main = new CliMode ( ) ;
78+ if ( cli && args . Contains ( R2 . Arg_NoUI ) ) {
79+ var main = new CliMode ( ) ;
8180
82- var rc = new RootCommand ( )
83- { } ;
81+ var rc = new RootCommand ( )
82+ { } ;
8483
85- var options = new Option [ ]
86- {
87- new Option < string > ( R2 . Arg_Input )
88- { } ,
89-
90- new Option < bool > ( R2 . Arg_NoUI )
91- {
92- Arity = ArgumentArity . Zero ,
84+ var options = new Option [ ]
85+ {
86+ new Option < string > ( R2 . Arg_Input )
87+ { } ,
9388
94- } ,
95-
96- } ;
89+ new Option < bool > ( R2 . Arg_NoUI )
90+ {
91+ Arity = ArgumentArity . Zero ,
9792
98- foreach ( Option option in options ) {
99- rc . AddOption ( option ) ;
100- }
93+ } ,
10194
102- rc . SetHandler ( main . RunAsync , ( Option < string > ) options [ 0 ] ) ;
95+ } ;
10396
104- var i = await rc . InvokeAsync ( args ) ;
97+ foreach ( Option option in options )
98+ {
99+ rc . AddOption ( option ) ;
100+ }
105101
106- return i ;
102+ rc . SetHandler ( main . RunAsync , ( Option < string > ) options [ 0 ] ) ;
107103
108- }
104+ var i = await rc . InvokeAsync ( args ) ;
109105
110- return ConsoleUtil . CODE_ERR ;
106+ return i ;
111107 }
112108 else {
113109 main1 :
You can’t perform that action at this time.
0 commit comments