diff --git a/src/main.rs b/src/main.rs index ca92005..4de02cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,12 @@ async fn main() -> eyre::Result<()> { .wrap_err(eyre!("Invalid config")) .with_suggestion(|| "Try running `--help`")?); - let graph = work::work_on_all(state).await; + let graph = tokio::select!{ + x = work::work_on_all(state) => {x} + _ = tokio::signal::ctrl_c() => { + return Err(eyre!("Interrupt signalled, exiting")); + } + }; let mut graph = graph.into_hierarchical(); graph.compute_recursive_sizes();