diff --git a/src/internal.rs b/src/internal.rs index 206c381..88fd1c7 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -100,3 +100,9 @@ fn expr_has_uppercase_char(expr: &Expr) -> bool { _ => false, } } + +/// Exit code representing a general error +pub const EXITCODE_ERROR: i32 = 1; + +/// Exit code representing that the process was killed by SIGINT +pub const EXITCODE_SIGINT: i32 = 130; diff --git a/src/main.rs b/src/main.rs index ac2f23e..36900c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,6 @@ extern crate num_cpus; extern crate regex; extern crate regex_syntax; -mod exit_codes; pub mod fshelper; pub mod lscolors; mod app; diff --git a/src/output.rs b/src/output.rs index 7ba8fb0..cc3fb46 100644 --- a/src/output.rs +++ b/src/output.rs @@ -6,8 +6,7 @@ // notice may not be copied, modified, or distributed except // according to those terms. -use exit_codes; -use internal::FdOptions; +use internal::{FdOptions, EXITCODE_ERROR, EXITCODE_SIGINT}; use lscolors::LsColors; use std::{fs, process}; @@ -32,7 +31,7 @@ pub fn print_entry(entry: &PathBuf, config: &FdOptions, wants_to_quit: &Arc, config: Arc) { receiver_thread.join().unwrap(); if wants_to_quit.load(Ordering::Relaxed) { - process::exit(exit_codes::SIGINT); + process::exit(EXITCODE_SIGINT); } }