Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to complete rustup/cargo commands?

I have rustup+rust+cargo installed using the official installation script.

How do I enable shell completions, to be able to type cargo <TAB> in the terminal and see the possible commands such as cargo check?

like image 233
AnonymousDuck Avatar asked Jan 20 '26 22:01

AnonymousDuck


1 Answers

You can run rustup completions and follow the instructions. For example, for bash you can run

mkdir -p ~/.local/share/bash-completion/completions

rustup completions bash       > ~/.local/share/bash-completion/completions/rustup
rustup completions bash cargo > ~/.local/share/bash-completion/completions/cargo

to generate completions for rustup and cargo respectively. Consult rustup completions for further details, e.g. for configuring zsh and fish completions.

like image 192
AnonymousDuck Avatar answered Jan 23 '26 10:01

AnonymousDuck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!