mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-05 19:00:33 -05:00
feat(main): catch ctrl-c to cleanup
this allows us to cleanup progress bar, print stats, finish tracing, etc.
This commit is contained in:
parent
52cae96ee2
commit
f26d178380
1 changed files with 4 additions and 0 deletions
|
|
@ -219,6 +219,7 @@ let main_cnf () : _ result =
|
|||
r
|
||||
|
||||
let main () =
|
||||
Sys.catch_break true;
|
||||
|
||||
(* instrumentation and tracing *)
|
||||
Sidekick_tef.with_setup @@ fun () ->
|
||||
|
|
@ -278,6 +279,9 @@ let () = match main() with
|
|||
| Invalid_argument e ->
|
||||
Format.printf "invalid argument:\n%s@." e;
|
||||
exit_ 127
|
||||
| Sys.Break ->
|
||||
Printf.printf "interrupted.\n%!";
|
||||
exit_ 1;
|
||||
| _ -> raise e
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue