OXYGENHUB

Coverage / src/main.rs 100.0%

10 of 10 lines run, 1 of 2 functions · run #9 on main · run missed

1
//! `spectra`: the control plane for AI coding agents.
2
//!
3
//! Command definitions and dispatch live in `cli`; each command group has
4
//! its own module there, as in `oxy`.
5
6
mod cli;
7
8
// Many small allocations from every thread (events, JSON, templates): mimalloc
9
// serves them from per-thread pages without the arena locks of glibc's.
10
#[global_allocator]
11
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
12
1369×
fn main() {
14
    // Behave like other CLI tools when output is piped into `head`: die
15
    // quietly on SIGPIPE instead of panicking on a failed write.
16
    #[cfg(unix)]
1769×
    unsafe {
1869×
        libc::signal(libc::SIGPIPE, libc::SIG_DFL);
1969×
    }
2069×
    match cli::run() {
2162×
        Ok(code) => std::process::exit(code),
227×
        Err(e) => {
237×
            cli::ui::init(false);
247×
            eprintln!("{} {e:#}", cli::ui::err("error:"));
257×
            std::process::exit(1);
26
        }
27
    }
28
}