diff --git a/Cargo.lock b/Cargo.lock index 0dd7591..440fbf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "didyoumean" -version = "1.1.3" +version = "1.1.4" dependencies = [ "atty", "clap 3.2.5", diff --git a/Cargo.toml b/Cargo.toml index b606f65..69626af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "didyoumean" authors = ["Hisbaan Noorani"] -version = "1.1.3" +version = "1.1.4" edition = "2021" license = "GPL-3.0" description = "A CLI spelling corrector" diff --git a/src/cli.rs b/src/cli.rs index 6ce3c3c..eaacca9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,7 @@ use clap::Parser; // Parse command line arguments to get the search term. #[derive(Parser)] -#[clap(author = "Hisbaan Noorani", version = "1.1.3", about = "Did You Mean: A cli spelling corrector", long_about = None)] +#[clap(author = "Hisbaan Noorani", version = "1.1.4", about = "Did You Mean: A cli spelling corrector", long_about = None)] pub struct Cli { pub search_term: Option, #[clap( diff --git a/src/main.rs b/src/main.rs index f67db1b..706d10b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -144,6 +144,9 @@ fn run_app() -> std::result::Result<(), Error> { // Print out results. if !args.clean_output { + if top_n_dists[0] == 0 { + println!("{} is spelled correctly\n", search_term.bold().green()); + } println!("{}", "Did you mean?".blue().bold()); } let mut items = vec!["".to_string(); args.number];