BREAKING: use environments to get informations

This commit is contained in:
iff 2023-07-31 14:12:45 +02:00
parent ee7e6886b9
commit 1b7b11bd3f
6 changed files with 128 additions and 67 deletions

View file

@ -1,12 +1,16 @@
mod args;
mod corrections;
mod shell;
mod style;
fn main() {
std::env::set_var("LC_ALL", "C");
args::handle_args();
let shell = shell::find_shell();
let last_command = shell::find_last_command(&shell);
let shell = std::env::var("_PR_SHELL").expect(
"No _PR_SHELL in environment. Did you aliased the binary with the correct arguments?",
);
let last_command = shell::last_command_expanded_alias(&shell);
let corrected_command = corrections::correct_command(&shell, &last_command);
if let Some(corrected_command) = corrected_command {