Skip to content

Commit af39b27

Browse files
authored
Merge pull request #28 from mrboring-forks/add-acceptLegalFileNamesOnly
Added acceptLegalFileNamesOnly
2 parents d8f4038 + cfb1237 commit af39b27

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ The new `Input` module contains functions for the underlying System.CommandLine
7272
* `optionMaybe` creates a named `Option<'T option>` that defaults to `None`.
7373

7474
### Input Properties
75+
* `acceptLegalFileNamesOnly` sets the option or argument to accept only values representing legal file names.
7576
* `acceptLegalFilePathsOnly` sets the option or argument to accept only values representing legal file paths.
7677
* `alias` adds an `Alias` to an `Option`
7778
* `aliases` adds one or more aliases to an `Option`

src/FSharp.SystemCommandLine/Inputs.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ module Input =
6868
| _ -> ()
6969
input
7070

71+
/// Configures the option or argument to accept only values representing legal file names.
72+
let acceptLegalFileNamesOnly (input: ActionInput<'T>) =
73+
input
74+
|> editOption (fun o -> o.AcceptLegalFileNamesOnly() |> ignore)
75+
|> editArgument (fun a -> a.AcceptLegalFileNamesOnly() |> ignore)
76+
7177
/// Configures the option or argument to accept only values representing legal file paths.
7278
let acceptLegalFilePathsOnly (input: ActionInput<'T>) =
7379
input

0 commit comments

Comments
 (0)