Skip to content

Commit

Permalink
Add better error message printing
Browse files Browse the repository at this point in the history
  • Loading branch information
ymherklotz committed Oct 29, 2024
1 parent 9794f64 commit 48496ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ OPTIONS
"

def main (args : List String) : IO Unit := do
let parsed ← IO.ofExcept <| parseArgs args
let parsed ←
try IO.ofExcept <| parseArgs args
catch
| .userError s => do
IO.eprintln ("error: " ++ s)
IO.print helpText
IO.Process.exit 1
| e => throw e
if parsed.help then
IO.print helpText
return
Expand Down

0 comments on commit 48496ce

Please sign in to comment.