Skip to content

Commit edd866b

Browse files
committed
Added Input.recursive for marking options as recursive (global).
1 parent d3dbaa3 commit edd866b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/FSharp.SystemCommandLine/Inputs.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ module Input =
102102

103103
/// Marks an option as required.
104104
let required (input: ActionInput<'T>) =
105-
input |> editOption (fun o -> o.Required <- true)
105+
input
106+
|> editOption (fun o -> o.Required <- true)
107+
108+
/// Marks an argument as required.
109+
/// When set to true, this option will be applied to its immediate parent command or commands and recursively to their subcommands.
110+
let recursive (input: ActionInput<'T>) =
111+
input
112+
|> editOption (fun o -> o.Recursive <- true)
106113

107114
/// Creates a named option of type `Option<'T option>` that defaults to `None`.
108115
let optionMaybe<'T> (name: string) =

0 commit comments

Comments
 (0)