This should be called before calling any cli method or printing any output.
()
| 9 | |
| 10 | /// This should be called before calling any cli method or printing any output. |
| 11 | pub fn reset_signal_pipe_handler() { |
| 12 | #[cfg(target_family = "unix")] |
| 13 | { |
| 14 | use nix::sys::signal; |
| 15 | |
| 16 | unsafe { |
| 17 | let _ = signal::signal(signal::Signal::SIGPIPE, signal::SigHandler::SigDfl) |
| 18 | .map_err(|e| println!("{:?}", e)); |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | /// May the Code be with You |
| 24 | #[derive(Parser)] |