Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 6 additions & 0 deletions src/FSharp.SystemCommandLine/Inputs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down