bootc_internal_utils/
lib.rs1mod command;
6pub use command::*;
7mod path;
8pub use path::*;
9mod iterators;
10pub use iterators::*;
11mod timestamp;
12pub use timestamp::*;
13mod tracing_util;
14pub use tracing_util::*;
15pub mod reexec;
17mod result_ext;
18pub use result_ext::*;
19
20pub const NAME: &str = "bootc";
22
23pub fn run_main<F>(f: F)
26where
27 F: FnOnce() -> anyhow::Result<()>,
28{
29 use std::io::Write as _;
30
31 use owo_colors::OwoColorize;
32
33 if let Err(e) = f() {
34 let mut stderr = anstream::stderr();
35 let _ = writeln!(stderr, "{}{:#}", "error: ".red(), e);
37 std::process::exit(1);
38 }
39}