diff --git a/README.md b/README.md index 6b22ce5..3c12ba0 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ The new `Input` module contains functions for the underlying System.CommandLine * `optionMaybe` creates a named `Option<'T option>` that defaults to `None`. ### Input Properties +* `acceptLegalFileNamesOnly` sets the option or argument to accept only values representing legal file names. * `acceptLegalFilePathsOnly` sets the option or argument to accept only values representing legal file paths. * `alias` adds an `Alias` to an `Option` * `aliases` adds one or more aliases to an `Option` diff --git a/src/FSharp.SystemCommandLine/Inputs.fs b/src/FSharp.SystemCommandLine/Inputs.fs index cbe2cc0..7150608 100644 --- a/src/FSharp.SystemCommandLine/Inputs.fs +++ b/src/FSharp.SystemCommandLine/Inputs.fs @@ -68,6 +68,12 @@ module Input = | _ -> () input + /// Configures the option or argument to accept only values representing legal file names. + let acceptLegalFileNamesOnly (input: ActionInput<'T>) = + input + |> editOption (fun o -> o.AcceptLegalFileNamesOnly() |> ignore) + |> editArgument (fun a -> a.AcceptLegalFileNamesOnly() |> ignore) + /// Configures the option or argument to accept only values representing legal file paths. let acceptLegalFilePathsOnly (input: ActionInput<'T>) = input