File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ let formatLong o =
2222let formatInput ( o : options ) =
2323 sprintf " --stringvalue: %s \n -i: %A \n -x: %b \n value: %s \n " o.stringValue o.intSequence o.boolValue ( formatLong o.longValue)
2424
25- let inline (| Success | Fail |) ( result : ParserResult < 'a >) =
25+ let inline (| Success | Help | Version | Fail |) ( result : ParserResult < 'a >) =
2626 match result with
2727 | :? Parsed< 'a> as parsed -> Success( parsed.Value)
28+ | :? NotParsed< 'a> as notParsed when notParsed.Errors.IsHelp() -> Help
29+ | :? NotParsed< 'a> as notParsed when notParsed.Errors.IsVersion() -> Version
2830 | :? NotParsed< 'a> as notParsed -> Fail( notParsed.Errors)
2931 | _ -> failwith " invalid parser result"
3032
@@ -34,3 +36,4 @@ let result = Parser.Default.ParseArguments<options>(args)
3436match result with
3537 | Success( opts) -> printf " %s " ( formatInput opts)
3638 | Fail( errs) -> printf " Invalid: %A , Errors: %u \n " args ( Seq.length errs)
39+ | Help | Version -> ()
You can’t perform that action at this time.
0 commit comments