OXYGENHUB
# 1931724b1d6b oxygen / src / main.rs
582 B · Rust · last changed Import the Oxygen specification and the first Rust implementation (root change) 1 month ago source blame history raw
1
//! `oxy`: command-line interface for Oxygen.
2
//!
3
//! Command definitions and dispatch live in `cli`; each command group has
4
//! its own module there.
5
6
mod cli;
7
8
fn main() {
9
    // Behave like other CLI tools when output is piped into `head`: die
10
    // quietly on SIGPIPE instead of panicking on a failed write.
11
    #[cfg(unix)]
12
    unsafe {
13
        libc::signal(libc::SIGPIPE, libc::SIG_DFL);
14
    }
15
    match cli::run() {
16
        Ok(code) => std::process::exit(code),
17
        Err(e) => {
18
            eprintln!("error: {e:#}");
19
            std::process::exit(1);
20
        }
21
    }
22
}