mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-11 22:10:09 +01:00
format: suggestion display
This commit is contained in:
parent
3e367a09dd
commit
9a56ff41ab
4 changed files with 402 additions and 407 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use colored::Colorize;
|
||||
|
||||
mod args;
|
||||
mod corrections;
|
||||
mod shell;
|
||||
mod style;
|
||||
mod suggestions;
|
||||
|
||||
fn main() {
|
||||
std::env::set_var("LC_ALL", "C");
|
||||
|
|
@ -13,18 +13,18 @@ fn main() {
|
|||
"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);
|
||||
let corrected_command = suggestions::suggest_command(&shell, &last_command);
|
||||
|
||||
if let Some(corrected_command) = corrected_command {
|
||||
if corrected_command != last_command {
|
||||
corrections::confirm_correction(&shell, &corrected_command, &last_command);
|
||||
suggestions::confirm_suggestion(&shell, &corrected_command, &last_command);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
println!(
|
||||
"No correction found for the command: {}\n",
|
||||
last_command.red().bold()
|
||||
last_command.red()
|
||||
);
|
||||
println!(
|
||||
"If you think there should be a correction, please open an issue or send a pull request!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue