mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -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
|
r
|
||||||
|
|
||||||
let main () =
|
let main () =
|
||||||
|
Sys.catch_break true;
|
||||||
|
|
||||||
(* instrumentation and tracing *)
|
(* instrumentation and tracing *)
|
||||||
Sidekick_tef.with_setup @@ fun () ->
|
Sidekick_tef.with_setup @@ fun () ->
|
||||||
|
|
@ -278,6 +279,9 @@ let () = match main() with
|
||||||
| Invalid_argument e ->
|
| Invalid_argument e ->
|
||||||
Format.printf "invalid argument:\n%s@." e;
|
Format.printf "invalid argument:\n%s@." e;
|
||||||
exit_ 127
|
exit_ 127
|
||||||
|
| Sys.Break ->
|
||||||
|
Printf.printf "interrupted.\n%!";
|
||||||
|
exit_ 1;
|
||||||
| _ -> raise e
|
| _ -> raise e
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue