Skip to content

Commit

Permalink
Rename suggestion to suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed May 9, 2022
1 parent 42e4417 commit bef0478
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
[package]
name = "suggestion"
version = "0.3.4"
name = "suggest"
version = "0.4.0"
edition = "2021"
authors = ["Ken Matsui <[email protected]>"]
description = "A minimal library & CLI tool to provide similar name suggestions like \"Did you mean?\""
license = "MIT"
readme = "README.md"
repository = "https://github.com/ken-matsui/suggest/"
homepage = "https://github.com/ken-matsui/suggest#readme"
documentation = "https://docs.rs/suggestion"
documentation = "https://docs.rs/suggest"

[dependencies]
clap = { version = "3.1", features = ["derive"] }
lev_distance = "0.1.1"

[[bin]]
name = "suggest"
path = "src/main.rs"
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# suggest [![crates.io version](https://img.shields.io/crates/v/suggestion.svg)](https://crates.io/crates/suggestion) [![crates.io downloads](https://img.shields.io/crates/d/suggestion.svg)](https://crates.io/crates/suggestion)
# suggest [![crates.io version](https://img.shields.io/crates/v/suggest.svg)](https://crates.io/crates/suggest) [![crates.io downloads](https://img.shields.io/crates/d/suggest.svg)](https://crates.io/crates/suggest)

A minimal library & CLI tool to provide similar name suggestions like "Did you mean?"
This library provides suggestion traits for all collection types in the standard library.
A WebAssembly package is also supported.

This library is intended to suggest a candidate from a list of unknown suggestions until runtime, in addition to the suggestion feature already available in [`clap`](https://github.com/clap-rs/clap#default-features).

> This crate was previously called [`suggestion`](https://crates.io/crates/suggestion) but renamed, and it'll be yanked.
## Examples

### Simple case

This example can be executed by the `cargo run --example simple` command.

```rust
use suggestion::Suggest;
use suggest::Suggest;

fn main() {
let input = "instakk";
Expand All @@ -39,7 +41,7 @@ Did you mean `install`?
### Specifying distance

```rust
use suggestion::Suggest;
use suggest::Suggest;

fn main() {
let input = "paoc";
Expand Down Expand Up @@ -77,7 +79,7 @@ Please let me know if anything is left out through issues or pull requests.
* `HashMap`
* `BTreeMap`

To suggest keys, use `suggestion::SuggestKey` trait.
To suggest keys, use `suggest::SuggestKey` trait.

### Sets

Expand All @@ -95,7 +97,7 @@ To suggest keys, use `suggestion::SuggestKey` trait.
### Installation

```bash
cargo install suggestion
cargo install suggest
```

#### WebAssembly
Expand All @@ -111,7 +113,7 @@ $ wapm install ken-matsui/suggest

```bash
$ suggest --help
suggestion 0.3.1
suggest 0.3.1
A minimal library & CLI tool to provide similar name suggestions like "Did you mean?"

USAGE:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use suggestion::Suggest;
use suggest::Suggest;

fn main() {
let input = "instakk";
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! # Example
//! ```
//! use suggestion::Suggest;
//! use suggest::Suggest;
//!
//! let input = "instakk";
//!
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Parser;
use suggestion::Suggest;
use suggest::Suggest;

#[derive(Parser, Debug)]
#[clap(version, about, long_about = None)]
Expand Down

0 comments on commit bef0478

Please sign in to comment.