mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 02:22:19 +00:00
Generate shell completion for uvx
(#7388)
## Summary Generate shell completion for uvx. Create a `uvx` toplevel command just for completion by combining `uv tool uvx` (hidden alias for `uv tool run`) with global arguments. This explicit combination is needed otherwise global arguments are missing (if they are missing, clap debug assertions fail when `uv tool run` arguments refer to global arguments in directives like conflicts with). Fixes #7258 ## Test Plan - Tested using bash using `eval "$(cargo run --bin uv generate-shell-completion bash)"`
This commit is contained in:
parent
d1c7cb8bc2
commit
e9378be919
3 changed files with 62 additions and 13 deletions
|
@ -76,6 +76,13 @@ pub struct Cli {
|
|||
#[command(subcommand)]
|
||||
pub command: Box<Commands>,
|
||||
|
||||
#[command(flatten)]
|
||||
pub top_level: TopLevelArgs,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(disable_help_flag = true, disable_version_flag = true)]
|
||||
pub struct TopLevelArgs {
|
||||
#[command(flatten)]
|
||||
pub cache_args: Box<CacheArgs>,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue