8 个版本
0.1.7 | 2023年5月12日 |
---|---|
0.1.6 | 2023年4月26日 |
#1 in #typo
每月下载量 77
5KB
58 代码行
suggest-command-not-found
未找到 shell 命令的错别字更正
用法
- 安装
suggest-command-not-found
$ cargo install suggest-command-not-found
- 将
command_not_found_handler
添加到您的~/.zshrc
如果您使用 Bash,请更新您的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 }
~/.bash_profile
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
依赖关系
~0–10MB
~53K SLoC