Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Last active December 13, 2017 23:19
Show Gist options
  • Save dustinlacewell-wk/2c412d797b61ceb65940b53fe49b1b7b to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/2c412d797b61ceb65940b53fe49b1b7b to your computer and use it in GitHub Desktop.
[<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