33// This file has been modified from the original form. See Notice.txt in the project root for more information.
44
55using System ;
6- using System . Collections ;
7- using System . Collections . Generic ;
8- using System . IO ;
9- using System . Linq ;
106using System . Reflection ;
11- using System . Text ;
127using System . Threading . Tasks ;
138
149namespace McMaster . Extensions . CommandLineUtils
@@ -20,41 +15,41 @@ namespace McMaster.Extensions.CommandLineUtils
2015 partial class CommandLineApplication
2116 {
2217 /// <summary>
23- /// Creates an instance of <typeparamref name="T "/>, matching <paramref name="args"/>
18+ /// Creates an instance of <typeparamref name="TApp "/>, matching <paramref name="args"/>
2419 /// to all attributes on the type, and then invoking a method named "Execute" if it exists.
2520 /// See <seealso cref="OptionAttribute" />, <seealso cref="ArgumentAttribute" />,
2621 /// <seealso cref="HelpOptionAttribute"/>, and <seealso cref="VersionOptionAttribute"/>.
2722 /// </summary>
2823 /// <param name="args">The arguments</param>
29- /// <typeparam name="T ">A type that should be bound to the arguments.</typeparam>
24+ /// <typeparam name="TApp ">A type that should be bound to the arguments.</typeparam>
3025 /// <exception cref="CommandParsingException">Thrown when arguments cannot be parsed correctly.</exception>
3126 /// <exception cref="InvalidOperationException">Thrown when attributes are incorrectly configured.</exception>
3227 /// <returns>The process exit code</returns>
33- public static int Execute < T > ( params string [ ] args )
34- where T : class , new ( )
35- => Execute < T > ( PhysicalConsole . Singleton , args ) ;
28+ public static int Execute < TApp > ( params string [ ] args )
29+ where TApp : class , new ( )
30+ => Execute < TApp > ( PhysicalConsole . Singleton , args ) ;
3631
3732 /// <summary>
38- /// Creates an instance of <typeparamref name="T "/>, matching <paramref name="args"/>
33+ /// Creates an instance of <typeparamref name="TApp "/>, matching <paramref name="args"/>
3934 /// to all attributes on the type, and then invoking a method named "Execute" if it exists.
4035 /// See <seealso cref="OptionAttribute" />, <seealso cref="ArgumentAttribute" />,
4136 /// <seealso cref="HelpOptionAttribute"/>, and <seealso cref="VersionOptionAttribute"/>.
4237 /// </summary>
4338 /// <param name="console">The console to use</param>
4439 /// <param name="args">The arguments</param>
45- /// <typeparam name="T ">A type that should be bound to the arguments.</typeparam>
40+ /// <typeparam name="TApp ">A type that should be bound to the arguments.</typeparam>
4641 /// <exception cref="CommandParsingException">Thrown when arguments cannot be parsed correctly.</exception>
4742 /// <exception cref="InvalidOperationException">Thrown when attributes are incorrectly configured.</exception>
4843 /// <returns>The process exit code</returns>
49- public static int Execute < T > ( IConsole console , params string [ ] args )
50- where T : class , new ( )
44+ public static int Execute < TApp > ( IConsole console , params string [ ] args )
45+ where TApp : class , new ( )
5146 {
5247 if ( console == null )
5348 {
5449 throw new ArgumentNullException ( nameof ( console ) ) ;
5550 }
5651
57- var applicationBuilder = new ReflectionAppBuilder < T > ( ) ;
52+ var applicationBuilder = new ReflectionAppBuilder < TApp > ( ) ;
5853 var bindResult = applicationBuilder . Bind ( console , args ) . GetBottomContext ( ) ;
5954 if ( IsShowingInfo ( bindResult ) )
6055 {
@@ -74,41 +69,41 @@ public static int Execute<T>(IConsole console, params string[] args)
7469 }
7570
7671 /// <summary>
77- /// Creates an instance of <typeparamref name="T "/>, matching <paramref name="args"/>
72+ /// Creates an instance of <typeparamref name="TApp "/>, matching <paramref name="args"/>
7873 /// to all attributes on the type, and then invoking a method named "Execute" if it exists.
7974 /// See <seealso cref="OptionAttribute" />, <seealso cref="ArgumentAttribute" />,
8075 /// <seealso cref="HelpOptionAttribute"/>, and <seealso cref="VersionOptionAttribute"/>.
8176 /// </summary>
8277 /// <param name="args">The arguments</param>
83- /// <typeparam name="T ">A type that should be bound to the arguments.</typeparam>
78+ /// <typeparam name="TApp ">A type that should be bound to the arguments.</typeparam>
8479 /// <exception cref="CommandParsingException">Thrown when arguments cannot be parsed correctly.</exception>
8580 /// <exception cref="InvalidOperationException">Thrown when attributes are incorrectly configured.</exception>
8681 /// <returns>The process exit code</returns>
87- public static Task < int > ExecuteAsync < T > ( params string [ ] args )
88- where T : class , new ( )
89- => ExecuteAsync < T > ( PhysicalConsole . Singleton , args ) ;
82+ public static Task < int > ExecuteAsync < TApp > ( params string [ ] args )
83+ where TApp : class , new ( )
84+ => ExecuteAsync < TApp > ( PhysicalConsole . Singleton , args ) ;
9085
9186 /// <summary>
92- /// Creates an instance of <typeparamref name="T "/>, matching <paramref name="args"/>
87+ /// Creates an instance of <typeparamref name="TApp "/>, matching <paramref name="args"/>
9388 /// to all attributes on the type, and then invoking a method named "Execute" if it exists.
9489 /// See <seealso cref="OptionAttribute" />, <seealso cref="ArgumentAttribute" />,
9590 /// <seealso cref="HelpOptionAttribute"/>, and <seealso cref="VersionOptionAttribute"/>.
9691 /// </summary>
9792 /// <param name="console">The console to use</param>
9893 /// <param name="args">The arguments</param>
99- /// <typeparam name="T ">A type that should be bound to the arguments.</typeparam>
94+ /// <typeparam name="TApp ">A type that should be bound to the arguments.</typeparam>
10095 /// <exception cref="CommandParsingException">Thrown when arguments cannot be parsed correctly.</exception>
10196 /// <exception cref="InvalidOperationException">Thrown when attributes are incorrectly configured.</exception>
10297 /// <returns>The process exit code</returns>
103- public static async Task < int > ExecuteAsync < T > ( IConsole console , params string [ ] args )
104- where T : class , new ( )
98+ public static async Task < int > ExecuteAsync < TApp > ( IConsole console , params string [ ] args )
99+ where TApp : class , new ( )
105100 {
106101 if ( console == null )
107102 {
108103 throw new ArgumentNullException ( nameof ( console ) ) ;
109104 }
110105
111- var applicationBuilder = new ReflectionAppBuilder < T > ( console ) ;
106+ var applicationBuilder = new ReflectionAppBuilder < TApp > ( console ) ;
112107 var bindResult = applicationBuilder . Bind ( console , args ) . GetBottomContext ( ) ;
113108 if ( IsShowingInfo ( bindResult ) )
114109 {
0 commit comments