cargo install 是否有用于更新已安装软件包的命令?
大家好!我是 Rust 新手,正在积极学习生态系统。我通过 `cargo install` 安装了一些有用的工具——例如 `ripgrep`、`bat` 和 `fd-find`。一切运行良好,但我注意到这些工具在 GitHub 上会定期更新。我想让它们保持最新状态,但找不到类似于 Ubuntu 中的 `apt update && apt upgrade` 或 Homebrew 中的 `brew upgrade` 的命令。
我尝试过:
```bash
cargo install --update ripgrep
```
但遇到了错误:`error: unexpected argument '--update' found`。然后我尝试了 `cargo update ripgrep`——也不起作用,因为 `cargo update` 只适用于带有 Cargo.toml 的项目中的依赖项。
看来,要更新每个工具,我需要先找到最新版本,然后执行 `cargo install ripgrep --force` 来重新安装它。当你有 10-15 个工具时,这很不方便。也许 Cargo 中有内置的命令用于批量更新?或者需要编写自己的脚本?请指教。