Download codex-rs/cli/src/exit_status.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/src/exit_status.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/cli/src/exit_status.rs
-
curl -L -o exit_status.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/src/exit_status.rs
684 Bytes
| pub(crate) fn handle_exit_status(status: std::process::ExitStatus) -> ! { | |
| use std::os::unix::process::ExitStatusExt; | |
| // Use ExitStatus to derive the exit code. | |
| if let Some(code) = status.code() { | |
| std::process::exit(code); | |
| } else if let Some(signal) = status.signal() { | |
| std::process::exit(128 + signal); | |
| } else { | |
| std::process::exit(1); | |
| } | |
| } | |
| pub(crate) fn handle_exit_status(status: std::process::ExitStatus) -> ! { | |
| if let Some(code) = status.code() { | |
| std::process::exit(code); | |
| } else { | |
| // Rare on Windows, but if it happens: use fallback code. | |
| std::process::exit(1); | |
| } | |
| } | |