From 6ee1140acd2c05c3ca790f82cd7944e0e3b38aa7 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Wed, 11 Sep 2024 21:48:58 -0700 Subject: [PATCH] generate-shell-completion: generate `uvx` shell completions for the fish shell Cc: #7258 --- crates/uv-cli/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 7221eb74a9ef..5328da0dc491 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -4240,4 +4240,12 @@ pub fn generate_shell_completion( buffer: &mut dyn std::io::Write, ) { shell.generate(&mut Cli::command(), buffer); + // `uvx` completion + #[allow(clippy::single_match)] // Hopefully, this will be implemented for other shells as well + match shell { + clap_complete_command::Shell::Fish => { + writeln!(buffer, r#"complete -c uvx --wraps "uv tool run""#).ok(); + } + _ => {} + }; }