Skip to content

Commit c566be4

Browse files
authored
doc: Update instructions on using native-completions (#15480)
`~/.local/share/bash-completion/completions/cargo` is more sensible, and [recommended by rustup](https://github.com/rust-lang/rustup/blob/e4f3ad6f893e56ca10f0a329c401a5eafab69607/src/cli/help.rs#L275). <!-- Thanks for submitting a pull request 🎉! Here are some tips for you: * If this is your first contribution, read "Cargo Contribution Guide" first: https://doc.crates.io/contrib/ * Run `cargo fmt --all` to format your code changes. * Small commits and pull requests are always preferable and easy to review. * If your idea is large and needs feedback from the community, read how: https://doc.crates.io/contrib/process/#working-on-large-features * Cargo takes care of compatibility. Read our design principles: https://doc.crates.io/contrib/design.html * When changing help text of cargo commands, follow the steps to generate docs: https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages * If your PR is not finished, set it as "draft" PR or add "WIP" in its title. * It's ok to use the CI resources to test your PR, but please don't abuse them. ### What does this PR try to resolve? Explain the motivation behind this change. A clear overview along with an in-depth explanation are helpful. You can use `Fixes #<issue number>` to associate this PR to an existing issue. ### How should we test and review this PR? Demonstrate how you test this change and guide reviewers through your PR. With a smooth review process, a pull request usually gets reviewed quicker. If you don't know how to write and run your tests, please read the guide: https://doc.crates.io/contrib/tests ### Additional information Other information you want to mention in this PR, such as prior arts, future extensions, an unresolved problem, or a TODO list. -->
2 parents a154422 + 15a7672 commit c566be4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/src/reference/unstable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,10 +1817,10 @@ When in doubt, you can discuss this in [#14520](https://github.com/rust-lang/car
18171817

18181818
### How to use native-completions feature:
18191819
- bash:
1820-
Add `source <(CARGO_COMPLETE=bash cargo +nightly)` to your .bashrc.
1820+
Add `source <(CARGO_COMPLETE=bash cargo +nightly)` to `$XDG_DATA_HOME/bash-completion/completions/cargo`, or `~/.local/share/bash-completion/completions/cargo` if `XDG_DATA_HOME` is not set.
18211821

18221822
- zsh:
1823-
Add `source <(CARGO_COMPLETE=zsh cargo +nightly)` to your .zshrc.
1823+
Add `source <(CARGO_COMPLETE=zsh cargo +nightly)` to your `.zshrc`.
18241824

18251825
- fish:
18261826
Add `source (CARGO_COMPLETE=fish cargo +nightly | psub)` to `$XDG_CONFIG_HOME/fish/completions/cargo.fish`

0 commit comments

Comments
 (0)