Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
use different exit codes in Functoria_runtime.with_argv (the command …
Browse files Browse the repository at this point in the history
…line

processor):
- on parse failure, 64
- if help or version was requested, 65

reasoning is to design reasonable restart-on-failure semantics, unhandled OCaml
exceptions return 2 (from 4.10 on they'll instead abort() - 255 in solo5), solo5
failure use 1. i chose the space 64..70 arbitrarily for "never restart" in
albatross (but am open for discussion about any other range).
  • Loading branch information
hannesm committed Oct 11, 2019
1 parent 7574616 commit 2f5aae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/functoria_runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ let with_argv keys s argv =
let t = List.fold_right gather keys (Term.pure ()) in
match Term.(eval ~argv (t, info s)) with
| `Ok _ -> initialized := true; ()
| `Error _ -> failwith "Key initialization failed"
| `Help | `Version -> exit 0
| `Error _ -> print_endline "Key initialization failed"; exit 64
| `Help | `Version -> exit 65

0 comments on commit 2f5aae1

Please sign in to comment.