Last active
December 13, 2017 23:19
-
-
Save dustinlacewell-wk/2c412d797b61ceb65940b53fe49b1b7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<EntryPoint>] | |
let main argv = | |
try | |
match ParseArgs argv with | |
| Options.NoCommand -> printfn "%s" "Subcommand required!" | |
| Options.Query o -> | |
let client = Client.New o.BaseUrl o.Id o.Key | |
let status = client.q { | |
let! ticket = client.Query o.Query o.From o.To | |
let! status = client.WaitOn ticket | |
return status } | |
match status with | |
| Fail fails -> printfn "Fail %A" fails | |
| Error error -> printfn "Error %A" error | |
| Pass ticket -> printfn "Pass %A" ticket | |
with | |
| Failure(msg) -> printfn "Error: %s" msg | |
| :? ArguParseException as ex -> printfn "%s" ex.Message | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment