Skip to content

Commit

Permalink
Auto merge of #14563 - epage:complete, r=weihanglo
Browse files Browse the repository at this point in the history
docs(unstable): Expand on completion documentation

### What does this PR try to resolve?

Wanting to improve the workflow for people testing completions

### How should we test and review this PR?

### Additional information
  • Loading branch information
bors committed Sep 18, 2024
2 parents a6de8c7 + 9a658f9 commit cb12afe
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -1695,21 +1695,38 @@ This feature moves the handwritten completion scripts to Rust native, making it
easier for us to add, extend and test new completions. This feature is enabled with the
nightly channel, without requiring additional `-Z` options.

Areas of particular interest for feedback
- Arguments that need escaping or quoting that aren't handled correctly
- Inaccuracies in the information
- Bugs in parsing of the command-line
- Arguments that don't report their completions
- If a known issue is being problematic

Feedback can be broken down into
- What completion candidates are reported
- Known issues: [#14520](https://github.com/rust-lang/cargo/issues/14520), [`A-completions`](https://github.com/rust-lang/cargo/labels/A-completions)
- [Report an issue](https://github.com/rust-lang/cargo/issues/new) or [discuss the behavior](https://github.com/rust-lang/cargo/issues/14520)
- Shell integration, command-line parsing, and completion filtering
- Known issues: [clap#3166](https://github.com/clap-rs/clap/issues/3166), [clap's `A-completions`](https://github.com/clap-rs/clap/labels/A-completion)
- [Report an issue](https://github.com/clap-rs/clap/issues/new/choose) or [discuss the behavior](https://github.com/clap-rs/clap/discussions/new/choose)

When in doubt, you can discuss this in [#14520](https://github.com/rust-lang/cargo/issues/14520) or on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo)

### How to use native-completions feature:
- bash:
Add `source <(CARGO_COMPLETE=bash cargo)` to your .bashrc.
Add `source <(CARGO_COMPLETE=bash cargo +nightly)` to your .bashrc.

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

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

- elvish:
Add `eval (E:CARGO_COMPLETE=elvish cargo | slurp)` to `$XDG_CONFIG_HOME/elvish/rc.elv`
Add `eval (E:CARGO_COMPLETE=elvish cargo +nightly | slurp)` to `$XDG_CONFIG_HOME/elvish/rc.elv`

- powershell:
Add `CARGO_COMPLETE=powershell cargo | Invoke-Expression` to `$PROFILE`.
Add `CARGO_COMPLETE=powershell cargo +nightly | Invoke-Expression` to `$PROFILE`.

# Stabilized and removed features

Expand Down

0 comments on commit cb12afe

Please sign in to comment.