@@ -346,14 +346,22 @@ type CommandLineConfigurationBuilder<'A, 'B, 'C, 'D, 'E, 'F, 'G, 'H, 'Output>()
346346 |> ignore
347347 this.CommandLineConfiguration
348348
349- /// Executes a Command with a handler that returns a Task<unit> or Task<int> .
350- member this.Run ( spec : CommandSpec < 'Inputs , Task < 'ReturnValue >>) =
349+ /// Executes a Command with a handler that returns a Task<unit>.
350+ member this.Run ( spec : CommandSpec < 'Inputs , Task < unit >>) =
351351 this.CommandLineConfiguration.RootCommand
352352 |> this.SetGeneralProperties spec
353353 |> this.SetHandlerTask spec
354354 |> ignore
355355 this.CommandLineConfiguration
356356
357+ /// Executes a Command with a handler that returns a Task<int>.
358+ member this.Run ( spec : CommandSpec < 'Inputs , Task < int >>) =
359+ this.CommandLineConfiguration.RootCommand
360+ |> this.SetGeneralProperties spec
361+ |> this.SetHandlerTaskInt spec
362+ |> ignore
363+ this.CommandLineConfiguration
364+
357365
358366/// Builds and executes a `System.CommandLine.RootCommand`.
359367type RootCommandBuilder < 'A , 'B , 'C , 'D , 'E , 'F , 'G , 'H , 'Output >( args : string array ) =
@@ -439,12 +447,18 @@ type CommandBuilder<'A, 'B, 'C, 'D, 'E, 'F, 'G, 'H, 'Output>(name: string) =
439447 |> this.SetGeneralProperties spec
440448 |> this.SetHandlerInt spec
441449
442- /// Executes a Command with a handler that returns a Task<unit> or Task<int> .
443- member this.Run ( spec : CommandSpec < 'Inputs , Task < 'ReturnValue >>) =
450+ /// Executes a Command with a handler that returns a Task<unit>.
451+ member this.Run ( spec : CommandSpec < 'Inputs , Task < unit >>) =
444452 Command( name)
445453 |> this.SetGeneralProperties spec
446454 |> this.SetHandlerTask spec
447455
456+ /// Executes a Command with a handler that returns a Task<int>.
457+ member this.Run ( spec : CommandSpec < 'Inputs , Task < int >>) =
458+ Command( name)
459+ |> this.SetGeneralProperties spec
460+ |> this.SetHandlerTaskInt spec
461+
448462
449463/// Builds a `System.CommandLineConfiguration` that can be passed to the `CommandLineParser.Parse` static method using computation expression syntax.
450464let commandLineConfiguration < 'A , 'B , 'C , 'D , 'E , 'F , 'G , 'H , 'Output > =
0 commit comments