suggest-command-not-found

Crates.iosuggest-command-not-found
lib.rssuggest-command-not-found
version0.1.8
sourcesrc
created_at2023-04-26 01:22:14.651606
updated_at2024-11-18 23:05:13.557563
descriptionTypo correction for not-found shell commands
homepagehttps://github.com/ken-matsui/suggest-command-not-found#readme
repositoryhttps://github.com/ken-matsui/suggest-command-not-found/
max_upload_size
id848944
size11,345
Ken Matsui (ken-matsui)

documentation

https://docs.rs/suggest-command-not-found

README

suggest-command-not-found crates.io version crates.io downloads

Typo correction for not-found shell commands

ScreenShot

Usage

  1. Install suggest-command-not-found
    $ cargo install suggest-command-not-found
    
  2. Add command_not_found_handler to your ~/.zshrc
    command_not_found_handler() {
      if command -v suggest-command-not-found &> /dev/null; then
        exec suggest-command-not-found "$@"
      else
        echo "zsh: command not found: $*"
      fi
    }
    
    Or update your ~/.bash_profile if you are using Bash:
    command_not_found_handle() {
      if command -v suggest-command-not-found &> /dev/null; then
        exec suggest-command-not-found "$@"
      else
        echo "bash: command not found: $*"
      fi
    }
    
  3. Make a typo
    $ carog new mypj
    Error: command not found: "carog" new mypj
       ==> Did you mean "cargo"?
    
    $ notacommand
    Error: command not found: "notacommand"
    
    $ echo $?
    127
    

Publish

GitHub Releases

$ git tag v0.1.0
$ git push origin v0.1.0

crates.io

$ cargo publish
Commit count: 30

cargo fmt