@@ -51,12 +51,10 @@ public static int Execute<TApp>(CommandLineContext context)
5151
5252 try
5353 {
54- using ( var app = new CommandLineApplication < TApp > ( ) )
55- {
56- app . SetContext ( context ) ;
57- app . Conventions . UseDefaultConventions ( ) ;
58- return app . Execute ( context . Arguments ) ;
59- }
54+ using var app = new CommandLineApplication < TApp > ( ) ;
55+ app . SetContext ( context ) ;
56+ app . Conventions . UseDefaultConventions ( ) ;
57+ return app . Execute ( context . Arguments ) ;
6058 }
6159 catch ( CommandParsingException ex )
6260 {
@@ -101,7 +99,7 @@ public static int Execute<TApp>(params string[] args)
10199 public static int Execute < TApp > ( IConsole console , params string [ ] args )
102100 where TApp : class
103101 {
104- args = args ?? new string [ 0 ] ;
102+ args ??= Util . EmptyArray < string > ( ) ;
105103 var context = new DefaultCommandLineContext ( console , Directory . GetCurrentDirectory ( ) , args ) ;
106104 return Execute < TApp > ( context ) ;
107105 }
@@ -134,7 +132,7 @@ public static Task<int> ExecuteAsync<TApp>(params string[] args)
134132 public static Task < int > ExecuteAsync < TApp > ( IConsole console , params string [ ] args )
135133 where TApp : class
136134 {
137- args = args ?? new string [ 0 ] ;
135+ args ??= Util . EmptyArray < string > ( ) ;
138136 var context = new DefaultCommandLineContext ( console , Directory . GetCurrentDirectory ( ) , args ) ;
139137 return ExecuteAsync < TApp > ( context ) ;
140138 }
0 commit comments