rustup
                                
                                 rustup copied to clipboard
                                
                                    rustup copied to clipboard
                            
                            
                            
                        Generate completion files on toolchain switch or update
Problem you are trying to solve
To utilize rustup completions, you are suggested to run rustup completions every time login shell is opened https://rust-lang.github.io/rustup/installation/index.html#enable-tab-completion-for-bash-fish-zsh-or-powershell. On some machines, this may drastically affect shell startup time
Solution you'd like
rustup completions can be called in a rustup internal post-install routine and generate proper completion files after updating or switching toolchain (or at first install); users will be able to source pre-baked completion files without calling rustup each time they login to shell
Notes
An example of how this process may look for zsh:
- calling rustup updatealtersrustupandcargoversions, new cli arguments are added
- after successful update, a post-install routine of completion generation started:
- rustup completions zsh rustup >$RUSTUP_HOME/completions/_rustupmakes completions for- rustup
- rustup completions zsh cargo >$CARGO_HOME/completions/_cargomakes completions for- cargo
- performing rm -f ~/.zcompdump; compinitto reset and reload completions inzsh
 
- if user has FPATH="$RUSTUP_HOME/completions:$CARGO_HOME/completions:$FPATH"in their.zshrc, the completions will work and be up-to-date