Skip to content

Commit

Permalink
Merge pull request #23 from hisbaan/correct-spelling-edge-case
Browse files Browse the repository at this point in the history
Add message when the user spells a search term correctly
  • Loading branch information
hisbaan authored Dec 22, 2022
2 parents 451432a + 40a0d6b commit 7ea53fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
#[clap(
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 7ea53fa

Please sign in to comment.