Crates.io | suggest-command-not-found |
lib.rs | suggest-command-not-found |
version | 0.1.7 |
source | src |
created_at | 2023-04-26 01:22:14.651606 |
updated_at | 2023-05-12 06:09:19.684282 |
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 | 9,654 |
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