Skip to content

--help switch throwing exception #366

@melston

Description

@melston

I have a simple F# program that works for all defined command-line options. However, when I run the application with --help I get an exception:

Unhandled Exception: System.Exception: CommandLine.Error[]
   at Program.main(String[] argv) in D:\Projects\Test\FSharp\StoryLib\StoryUpdate\Program.fs:line 46

This line is the last line in the match of the parsing result.

In addition, using the two match options shown in the docs I get a warning about an incomplete pattern match on the expression. It appears that there should be more than

    match args with 
    | :? Parsed<Options> as parsed -> doActions parsed.Value
    | :? NotParsed<Options> as notParsed -> failwith (notParsed.Errors |> string)
    // should there be a third option here?

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