Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message when the user spells a search term correctly #23

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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