Skip to content

How to use with F#? #941

@sgaliamov

Description

@sgaliamov

Hi, I'm trying to use it in F#:

module Program

open System.CommandLine
open System.CommandLine.Invocation;
open System

let [<EntryPoint>] main args =
    let root = new RootCommand()
    let option = new Option<string>("--test")
    root.AddOption option
    root.Handler <- CommandHandler.Create<string>(fun (test: string) -> Console.WriteLine test)
    root.Invoke args

Handler is invoked, but test argument is null. What I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions