Skip to content

Support for F# Option Type

Choose a tag to compare

@JordanMarr JordanMarr released this 24 Mar 04:35
· 243 commits to main since this release

v0.4.0-alpha

New Features

  • Add support for F# option types via Input.OptionMaybe and Input.ArgumentMaybe (See README.md for updated examples)
  • Added FSharp.SystemCommandLine.Aliases module with Opt<'T> and Arg<'T> convenience aliases for System.CommandLine.Option<'T> and System.CommandLine.Argument<'T>. (This should only be needed if you need to fall back to the core API in the case that a feature is missing from the Input.Option and Input.Argument helpers.)

Breaking Changes

  • Reworked all Input.Option and Input.Argument overloads that took a getDefaultValue anonymous function to use a defaultValue instead. This makes the most common use case much cleaner for F# by removing the anonymous function syntax.

Before:

let words = Input.Option(["--word"; "-w"], (fun () -> Array.empty), "A list of words to be appended")

After:

let words = Input.Option(["--word"; "-w"], Array.empty, "A list of words to be appended")