Crates.io | suggest-command-not-found |
lib.rs | suggest-command-not-found |
version | 0.1.8 |
source | src |
created_at | 2023-04-26 01:22:14.651606 |
updated_at | 2024-11-18 23:05:13.557563 |
description | Typo correction for not-found shell commands |
homepage | https://github.com/ken-matsui/suggest-command-not-found#readme |
repository | https://github.com/ken-matsui/suggest-command-not-found/ |
max_upload_size | |
id | 848944 |
size | 11,345 |
Typo correction for not-found shell commands
suggest-command-not-found
$ cargo install suggest-command-not-found
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
}
$ carog new mypj
Error: command not found: "carog" new mypj
==> Did you mean "cargo"?
$ notacommand
Error: command not found: "notacommand"
$ echo $?
127
$ git tag v0.1.0
$ git push origin v0.1.0
$ cargo publish