Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup: add completions #210130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

rustup: add completions #210130

wants to merge 1 commit into from

Conversation

kamilwaz
Copy link

@kamilwaz kamilwaz commented Mar 7, 2025

Add completions for cargo too (if exists)

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Add completions for cargo too (if exists)
@github-actions github-actions bot added the rust Rust use is a significant feature of the PR or issue label Mar 7, 2025
@@ -34,7 +34,16 @@ def install
rust-gdb rust-gdbgui rust-lldb rustc rustdoc rustfmt rustup].each do |name|
bin.install_symlink bin/"rustup-init" => name
end
generate_completions_from_executable(bin/"rustup", "completions")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't this generate everything?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, this command generates only a script for rustup. It also supports cargo, but it needs to be called separately.

Here’s how it looks in practice:

$ rustup completions zsh | grep compdef
#compdef rustup
    compdef _rustup rustup
$ rustup completions zsh cargo | grep compdef
#compdef cargo

@chenrui333 chenrui333 changed the title rustup 1.28.1 rustup: add completions Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Rust use is a significant feature of the PR or issue shell-completion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants