OXYGENHUB
# 73d592e763ab oxygen / src / main.rs
636 B · Rust · last changed Pack merging above 16 packs; modern CLI presentation (colour, spinners, --plain, NO_COLOR); oxy prompt with manifest-based dirty check and docs/prompt.md 1 month ago source blame history raw
ff0af1ee unknown 1
//! `oxy`: command-line interface for Oxygen.
fce44ae9 Andy McCall ↶ 2
//!
3
//! Command definitions and dispatch live in `cli`; each command group has
4
//! its own module there.
1983686f Andy McCall ↶ 5
fce44ae9 Andy McCall ↶ 6
mod cli;
1983686f Andy McCall ↶ 7
ff0af1ee unknown 8
fn main() {
5b1114a0 Andy McCall ↶ 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
    }
fce44ae9 Andy McCall ↶ 15
    match cli::run() {
ff0af1ee unknown 16
        Ok(code) => std::process::exit(code),
17
        Err(e) => {
135212de Andy McCall ↶ 18
            cli::ui::init(false);
19
            eprintln!("{} {e:#}", cli::ui::err("error:"));
ff0af1ee unknown 20
            std::process::exit(1);
21
        }
22
    }
23
}