Skip to content

Commit 43f154d

Browse files
committed
With large number of shared inputs from different commands allow a sequence
1 parent ff32c69 commit 43f154d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/FSharp.SystemCommandLine/CommandBuilders.fs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ type BaseCommandBuilder<'A, 'B, 'C, 'D, 'E, 'F, 'G, 'H, 'Output>() =
125125
member this.Add(spec: CommandSpec<'Inputs, 'Output>, extraInput: HandlerInput<'Value>) =
126126
{ spec with ExtraInputs = spec.ExtraInputs @ [ extraInput ] }
127127

128+
[<CustomOperation("add")>]
129+
member this.Add(spec: CommandSpec<'Inputs, 'Output>, extraInput: HandlerInput seq) =
130+
{ spec with ExtraInputs = spec.ExtraInputs @ (extraInput |> List.ofSeq) }
131+
132+
[<CustomOperation("add")>]
133+
member this.Add(spec: CommandSpec<'Inputs, 'Output>, extraInput: HandlerInput<'Value> seq) =
134+
{ spec with ExtraInputs = spec.ExtraInputs @ (extraInput |> Seq.cast |> List.ofSeq) }
135+
128136
/// Sets general properties on the command.
129137
member this.SetGeneralProperties (spec: CommandSpec<'T, 'U>) (cmd: Command) =
130138
cmd.Description <- spec.Description

0 commit comments

Comments
 (0)