File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ let formatLong o =
22
22
let formatInput ( o : options ) =
23
23
sprintf " --stringvalue: %s \n -i: %A \n -x: %b \n value: %s \n " o.stringValue o.intSequence o.boolValue ( formatLong o.longValue)
24
24
25
- let inline (| Success | Fail |) ( result : ParserResult < 'a >) =
25
+ let inline (| Success | Help | Version | Fail |) ( result : ParserResult < 'a >) =
26
26
match result with
27
27
| :? 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
28
30
| :? NotParsed< 'a> as notParsed -> Fail( notParsed.Errors)
29
31
| _ -> failwith " invalid parser result"
30
32
@@ -34,3 +36,4 @@ let result = Parser.Default.ParseArguments<options>(args)
34
36
match result with
35
37
| Success( opts) -> printf " %s " ( formatInput opts)
36
38
| 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