@@ -9,9 +9,9 @@ namespace Microsoft.DotNet.Cli.Extensions
9
9
{
10
10
public static class OptionForwardingExtensions
11
11
{
12
- public static ForwardedOption < T > Forward < T > ( this ForwardedOption < T > option ) => option . SetForwardingFunction ( ( o ) => new string [ ] { option . Name } ) ;
12
+ public static ForwardedOption < T > Forward < T > ( this ForwardedOption < T > option ) => option . SetForwardingFunction ( ( T o ) => new string [ ] { option . Name } ) ;
13
13
14
- public static ForwardedOption < T > ForwardAs < T > ( this ForwardedOption < T > option , string value ) => option . SetForwardingFunction ( ( o ) => new string [ ] { value } ) ;
14
+ public static ForwardedOption < T > ForwardAs < T > ( this ForwardedOption < T > option , string value ) => option . SetForwardingFunction ( ( T o ) => new string [ ] { value } ) ;
15
15
16
16
public static ForwardedOption < T > ForwardAsSingle < T > ( this ForwardedOption < T > option , Func < T , string > format ) => option . SetForwardingFunction ( format ) ;
17
17
@@ -24,7 +24,7 @@ public static class OptionForwardingExtensions
24
24
/// <returns>The option</returns>
25
25
public static ForwardedOption < string > ForwardAsOutputPath ( this ForwardedOption < string > option , string outputPropertyName , bool surroundWithDoubleQuotes = false )
26
26
{
27
- return option . SetForwardingFunction ( ( o ) =>
27
+ return option . SetForwardingFunction ( ( string o ) =>
28
28
{
29
29
string argVal = CommandDirectoryContext . GetFullPath ( o ) ;
30
30
if ( surroundWithDoubleQuotes )
@@ -136,13 +136,13 @@ public ForwardedOption<T> SetForwardingFunction(Func<T, string> format)
136
136
137
137
public ForwardedOption < T > SetForwardingFunction ( Func < T , ParseResult , IEnumerable < string > > func )
138
138
{
139
- ForwardingFunction = ( parseResult ) => parseResult . GetResult ( this ) is not null ? func ( parseResult . GetValue ( this ) , parseResult ) : Array . Empty < string > ( ) ;
139
+ ForwardingFunction = ( ParseResult parseResult ) => parseResult . GetResult ( this ) is not null ? func ( parseResult . GetValue < T > ( this ) , parseResult ) : Array . Empty < string > ( ) ;
140
140
return this ;
141
141
}
142
142
143
143
public Func < ParseResult , IEnumerable < string > > GetForwardingFunction ( Func < T , IEnumerable < string > > func )
144
144
{
145
- return ( parseResult ) => parseResult . GetResult ( this ) is not null ? func ( parseResult . GetValue ( this ) ) : Array . Empty < string > ( ) ;
145
+ return ( ParseResult parseResult ) => parseResult . GetResult ( this ) is not null ? func ( parseResult . GetValue < T > ( this ) ) : Array . Empty < string > ( ) ;
146
146
}
147
147
148
148
public Func < ParseResult , IEnumerable < string > > GetForwardingFunction ( )
0 commit comments