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

Move uvx shell completion to uvx --generate-shell-completion #7511

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bluss
Copy link
Contributor

@bluss bluss commented Sep 18, 2024

Summary

Because a problem was found with Powershell and combining the generated completion scripts for uv and uvx, let's try separating uv and uvx command completion scripts.

The generated powershell script template can be seen in clap_complete source, and it starts with using directives, which makes it impossible (apparently) to concatenate two of those script outputs.

As a side effect, this is available under uv tool run --generate-shell-completion too.

Fixes #7482

Test Plan

  • eval "$(cargo run --bin uvx -- --generate-shell-completion bash)"
  • Test Powershell

Because a problem was found with Powershell and combining the generated
completion scripts for uv and uvx, let's try separating uv and uvx
command completion scripts.
@bluss
Copy link
Contributor Author

bluss commented Sep 18, 2024

Link to the powershell generator template - https://docs.rs/clap_complete/4.5.28/src/clap_complete/aot/shells/powershell.rs.html#28 - IMO we should not try to patch the output of the generator, but it seems to be possible, feel free to go that route if you want to.

@bluss bluss force-pushed the uvx-complete branch 5 times, most recently from 5198786 to 5c69652 Compare September 18, 2024 17:55
@bluss
Copy link
Contributor Author

bluss commented Sep 19, 2024

Cc @ilyagr if you are interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv generate-shell-completion powershell script error in uv 0.4.11.
2 participants