@@ -25,22 +25,22 @@ type ActionContext =
2525 CancellationToken = System.Threading.CancellationToken.None
2626 }
2727
28- type HandlerInputSource =
28+ type ActionInputSource =
2929 | ParsedOption of Option
3030 | ParsedArgument of Argument
3131 | Context
3232
33- type HandlerInput ( source : HandlerInputSource ) =
33+ type ActionInput ( source : ActionInputSource ) =
3434 member this.Source = source
3535
36- type HandlerInput < 'T >( inputType : HandlerInputSource ) =
37- inherit HandlerInput ( inputType)
36+ type ActionInput < 'T >( inputType : ActionInputSource ) =
37+ inherit ActionInput ( inputType)
3838
3939 /// Converts a System.CommandLine.Option<'T> for usage with the CommandBuilder.
40- static member OfOption < 'T >( o : Option < 'T >) = o :> Option |> ParsedOption |> HandlerInput < 'T>
40+ static member OfOption < 'T >( o : Option < 'T >) = o :> Option |> ParsedOption |> ActionInput < 'T>
4141
4242 /// Converts a System.CommandLine.Argument<'T> for usage with the CommandBuilder.
43- static member OfArgument < 'T >( a : Argument < 'T >) = a :> Argument |> ParsedArgument |> HandlerInput < 'T>
43+ static member OfArgument < 'T >( a : Argument < 'T >) = a :> Argument |> ParsedArgument |> ActionInput < 'T>
4444
4545 /// Gets the value of an Option or Argument from the Parser.
4646 member this.GetValue ( parseResult : ParseResult ) =
@@ -52,47 +52,47 @@ type HandlerInput<'T>(inputType: HandlerInputSource) =
5252module Input =
5353
5454 let context =
55- HandlerInput < ActionContext>( Context)
55+ ActionInput < ActionContext>( Context)
5656
5757 let option < 'T > ( name : string ) =
58- Option< 'T>( name) |> HandlerInput .OfOption
58+ Option< 'T>( name) |> ActionInput .OfOption
5959
60- let editOption ( edit : Option < 'T > -> unit ) ( hi : HandlerInput < 'T >) =
60+ let editOption ( edit : Option < 'T > -> unit ) ( hi : ActionInput < 'T >) =
6161 match hi.Source with
6262 | ParsedOption o -> o :?> Option< 'T> |> edit
6363 | _ -> ()
6464 hi
6565
66- let editArgument ( edit : Argument < 'T > -> unit ) ( hi : HandlerInput < 'T >) =
66+ let editArgument ( edit : Argument < 'T > -> unit ) ( hi : ActionInput < 'T >) =
6767 match hi.Source with
6868 | ParsedArgument a -> a :?> Argument< 'T> |> edit
6969 | _ -> ()
7070 hi
7171
72- let aliases ( aliases : string seq ) ( hi : HandlerInput < 'T >) =
72+ let aliases ( aliases : string seq ) ( hi : ActionInput < 'T >) =
7373 hi |> editOption ( fun o -> aliases |> Seq.iter o.Aliases.Add)
7474
75- let alias ( alias : string ) ( hi : HandlerInput < 'T >) =
75+ let alias ( alias : string ) ( hi : ActionInput < 'T >) =
7676 hi |> editOption ( fun o -> o.Aliases.Add alias)
7777
78- let desc ( description : string ) ( hi : HandlerInput < 'T >) =
78+ let desc ( description : string ) ( hi : ActionInput < 'T >) =
7979 hi
8080 |> editOption ( fun o -> o.Description <- description)
8181 |> editArgument ( fun a -> a.Description <- description)
8282
83- let defaultValue ( defaultValue : 'T ) ( hi : HandlerInput < 'T >) =
83+ let defaultValue ( defaultValue : 'T ) ( hi : ActionInput < 'T >) =
8484 hi
8585 |> editOption ( fun o -> o.DefaultValueFactory <- ( fun _ -> defaultValue))
8686 |> editArgument ( fun a -> a.DefaultValueFactory <- ( fun _ -> defaultValue))
8787
8888 let def = defaultValue
8989
90- let defFactory ( defaultValueFactory : Parsing.ArgumentResult -> 'T ) ( hi : HandlerInput < 'T >) =
90+ let defFactory ( defaultValueFactory : Parsing.ArgumentResult -> 'T ) ( hi : ActionInput < 'T >) =
9191 hi
9292 |> editOption ( fun o -> o.DefaultValueFactory <- defaultValueFactory)
9393 |> editArgument ( fun a -> a.DefaultValueFactory <- defaultValueFactory)
9494
95- let required ( hi : HandlerInput < 'T >) =
95+ let required ( hi : ActionInput < 'T >) =
9696 hi |> editOption ( fun o -> o.Required <- true )
9797
9898 let optionMaybe < 'T > ( name : string ) =
@@ -107,11 +107,11 @@ module Input =
107107 )
108108 o.Arity <- ArgumentArity( 0 , 1 )
109109 o.DefaultValueFactory <- ( fun _ -> None)
110- HandlerInput .OfOption< 'T option> o
110+ ActionInput .OfOption< 'T option> o
111111
112112 let argument < 'T > ( name : string ) =
113113 let a = Argument< 'T>( name)
114- HandlerInput .OfArgument< 'T> a
114+ ActionInput .OfArgument< 'T> a
115115
116116 let argumentMaybe < 'T > ( name : string ) =
117117 let a = Argument< 'T option>( name)
@@ -122,104 +122,104 @@ module Input =
122122 | [ token ] -> MaybeParser.parseTokenValue token.Value
123123 | _ :: _ -> failwith " F# Option can only be used with a single argument."
124124 )
125- HandlerInput .OfArgument< 'T option> a
125+ ActionInput .OfArgument< 'T option> a
126126
127127 let ofOption ( o : Option < 'T >) =
128- HandlerInput .OfOption< 'T> o
128+ ActionInput .OfOption< 'T> o
129129
130130 let ofArgument ( a : Argument < 'T >) =
131- HandlerInput .OfArgument< 'T> a
131+ ActionInput .OfArgument< 'T> a
132132
133133/// Creates CLI options and arguments to be passed as command `inputs`.
134134type Input =
135135
136136 /// Converts a System.CommandLine.Option<'T> for usage with the CommandBuilder.
137137 [<Obsolete( " Use Input.ofOption instead" ) >]
138- static member OfOption < 'T >( o : Option < 'T >) : HandlerInput < 'T > =
138+ static member OfOption < 'T >( o : Option < 'T >) : ActionInput < 'T > =
139139 invalidOp " This method has been removed."
140140
141141 /// Converts a System.CommandLine.Argument<'T> for usage with the CommandBuilder.
142142 [<Obsolete( " Use Input.ofArgument instead" ) >]
143- static member OfArgument < 'T >( a : Argument < 'T >) : HandlerInput < 'T > =
143+ static member OfArgument < 'T >( a : Argument < 'T >) : ActionInput < 'T > =
144144 invalidOp " This method has been removed."
145145
146146 /// Creates a CLI option of type 'T with the ability to manually configure the underlying properties.
147147 [<Obsolete " Use Input.option instead." >]
148- static member Option < 'T >( name : string , configure : Option < 'T > -> unit ) : HandlerInput < 'T > =
148+ static member Option < 'T >( name : string , configure : Option < 'T > -> unit ) : ActionInput < 'T > =
149149 invalidOp " This method has been removed."
150150
151151 /// Creates a CLI option of type 'T with the ability to manually configure the underlying properties.
152152 [<Obsolete " Use Input.option instead." >]
153- static member Option < 'T >( aliases : string seq , configure : Option < 'T > -> unit ) : HandlerInput < 'T > =
153+ static member Option < 'T >( aliases : string seq , configure : Option < 'T > -> unit ) : ActionInput < 'T > =
154154 invalidOp " This method has been removed."
155155
156156 /// Creates a CLI argument of type 'T with the ability to manually configure the underlying properties.
157157 [<Obsolete " Use Input.argument instead." >]
158- static member Argument < 'T >( name : string , configure : Argument < 'T > -> unit ) : HandlerInput < 'T > =
158+ static member Argument < 'T >( name : string , configure : Argument < 'T > -> unit ) : ActionInput < 'T > =
159159 invalidOp " This method has been removed."
160160
161161 /// Creates a CLI option of type 'T.
162162 [<Obsolete " Use Input.option instead." >]
163- static member Option < 'T >( name : string , ? description : string ) : HandlerInput < 'T > =
163+ static member Option < 'T >( name : string , ? description : string ) : ActionInput < 'T > =
164164 invalidOp " This method has been removed."
165165
166166 /// Creates a CLI option of type 'T.
167167 [<Obsolete " Use Input.option instead." >]
168- static member Option < 'T >( aliases : string seq , ? description : string ) : HandlerInput < 'T > =
168+ static member Option < 'T >( aliases : string seq , ? description : string ) : ActionInput < 'T > =
169169 invalidOp " This method has been removed."
170170
171171 /// Creates a CLI option of type 'T with a default value.
172172 [<Obsolete " Use Input.option instead." >]
173- static member Option < 'T >( name : string , defaultValue : 'T , ? description : string ) : HandlerInput < 'T > =
173+ static member Option < 'T >( name : string , defaultValue : 'T , ? description : string ) : ActionInput < 'T > =
174174 invalidOp " This method has been removed."
175175
176176 /// Creates a CLI option of type 'T with a default value.
177177 [<Obsolete " Use Input.option instead." >]
178- static member Option < 'T >( aliases : string seq , defaultValue : 'T , ? description : string ) : HandlerInput < 'T > =
178+ static member Option < 'T >( aliases : string seq , defaultValue : 'T , ? description : string ) : ActionInput < 'T > =
179179 invalidOp " This method has been removed."
180180
181181 /// Creates a CLI option of type 'T that is required.
182182 [<Obsolete " Use Input.option + Input.required instead." >]
183- static member OptionRequired < 'T >( aliases : string seq , ? description : string ) : HandlerInput < 'T > =
183+ static member OptionRequired < 'T >( aliases : string seq , ? description : string ) : ActionInput < 'T > =
184184 invalidOp " This method has been removed."
185185
186186 /// Creates a CLI option of type 'T that is required.
187187 [<Obsolete " Use Input.option + Input.required instead." >]
188- static member OptionRequired < 'T >( name : string , ? description : string ) : HandlerInput < 'T > =
188+ static member OptionRequired < 'T >( name : string , ? description : string ) : ActionInput < 'T > =
189189 invalidOp " This method has been removed."
190190
191191 /// Creates a CLI option of type 'T option with the ability to manually configure the underlying properties.
192192 [<Obsolete " Use Input.optionMaybe instead." >]
193- static member OptionMaybe < 'T >( aliases : string seq , configure : Option < 'T option > -> unit ) : HandlerInput < 'T option > =
193+ static member OptionMaybe < 'T >( aliases : string seq , configure : Option < 'T option > -> unit ) : ActionInput < 'T option > =
194194 invalidOp " This method has been removed."
195195
196196 /// Creates a CLI option of type 'T option with the ability to manually configure the underlying properties.
197197 [<Obsolete " Use Input.optionMaybe instead." >]
198- static member OptionMaybe < 'T >( name : string , configure : Option < 'T option > -> unit ) : HandlerInput < 'T option > =
198+ static member OptionMaybe < 'T >( name : string , configure : Option < 'T option > -> unit ) : ActionInput < 'T option > =
199199 invalidOp " This method has been removed."
200200
201201 /// Creates a CLI option of type 'T option.
202202 [<Obsolete " Use Input.optionMaybe instead." >]
203- static member OptionMaybe < 'T >( aliases : string seq , ? description : string ) : HandlerInput < 'T option > =
203+ static member OptionMaybe < 'T >( aliases : string seq , ? description : string ) : ActionInput < 'T option > =
204204 invalidOp " This method has been removed."
205205
206206 /// Creates a CLI option of type 'T option.
207- static member OptionMaybe < 'T >( name : string , ? description : string ) : HandlerInput < 'T option > =
207+ static member OptionMaybe < 'T >( name : string , ? description : string ) : ActionInput < 'T option > =
208208 invalidOp " This method has been removed."
209209
210210 /// Creates a CLI argument of type 'T.
211211 [<Obsolete " Use Input.argument instead." >]
212- static member Argument < 'T >( name : string , ? description : string ) : HandlerInput < 'T > =
212+ static member Argument < 'T >( name : string , ? description : string ) : ActionInput < 'T > =
213213 invalidOp " This method has been removed."
214214
215215 /// Creates a CLI argument of type 'T with a default value.
216216 [<Obsolete " Use Input.argument instead." >]
217- static member Argument < 'T >( name : string , defaultValue : 'T , ? description : string ) : HandlerInput < 'T > =
217+ static member Argument < 'T >( name : string , defaultValue : 'T , ? description : string ) : ActionInput < 'T > =
218218 invalidOp " This method has been removed."
219219
220220 /// Creates a CLI argument of type 'T option.
221221 [<Obsolete " Use Input.argumentMaybe instead." >]
222- static member ArgumentMaybe < 'T >( name : string , ? description : string ) : HandlerInput < 'T option > =
222+ static member ArgumentMaybe < 'T >( name : string , ? description : string ) : ActionInput < 'T option > =
223223 invalidOp " This method has been removed."
224224
225225 /// Passes the `InvocationContext` to the handler.
0 commit comments