From 9147da3914b1d11049d1347be4994257a4db3904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Oct 2024 10:55:22 +0300 Subject: [PATCH 1/2] feat(uv): add 3rd party fallback completion loader https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion --- completions/.gitignore | 1 + completions/Makefile.am | 3 +++ 2 files changed, 4 insertions(+) diff --git a/completions/.gitignore b/completions/.gitignore index bbba1a2c2b7..d06dcb93228 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -323,6 +323,7 @@ /_trivy /typeset /_upctl +/_uv /_vacuum /vgcfgbackup /vgcfgrestore diff --git a/completions/Makefile.am b/completions/Makefile.am index fd5cf57601e..0da13468de5 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -904,6 +904,7 @@ CLEANFILES = \ _trivy \ typeset \ _upctl \ + _uv \ _vacuum \ vgcfgbackup \ vgcfgrestore \ @@ -1213,6 +1214,8 @@ endif rpmbuild rpmbuild-md5 $(ss) rpm2tgz \ rpm2targz rpm2txz + $(ss) _ruff \ + _uv $(ss) smbclient \ smbcacls smbcquotas smbget smbpasswd smbtar smbtree $(ss) sbcl \ From 11ae8410fd757c6e72c7426128a1227ad3eff135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Oct 2024 10:59:56 +0300 Subject: [PATCH 2/2] feat(uvx): add 3rd party fallback completion loader https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion --- completions/Makefile.am | 1 + completions/_uvx | 8 ++++++++ test/fallback/completions/Makefile.am | 1 + test/fallback/completions/uvx | 1 + 4 files changed, 11 insertions(+) create mode 100644 completions/_uvx create mode 120000 test/fallback/completions/uvx diff --git a/completions/Makefile.am b/completions/Makefile.am index 0da13468de5..bf392161f96 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -455,6 +455,7 @@ bashcomp_DATA = 2to3 \ useradd \ userdel \ usermod \ + _uvx \ valgrind \ _vault \ vipw \ diff --git a/completions/_uvx b/completions/_uvx new file mode 100644 index 00000000000..f08d3f66baf --- /dev/null +++ b/completions/_uvx @@ -0,0 +1,8 @@ +# 3rd party completion loader for commands emitting -*- shell-script -*- +# their completion using "$cmd --generate-shell-completion bash". +# +# This serves as a fallback in case the completion is not installed otherwise. + +eval -- "$("$1" --generate-shell-completion bash 2>/dev/null)" + +# ex: filetype=sh diff --git a/test/fallback/completions/Makefile.am b/test/fallback/completions/Makefile.am index 160cdd58d4b..c8057f0f5e0 100644 --- a/test/fallback/completions/Makefile.am +++ b/test/fallback/completions/Makefile.am @@ -47,6 +47,7 @@ EXTRA_DIST = \ udevadm \ umount \ umount.linux \ + uvx \ vault \ write \ xm \ diff --git a/test/fallback/completions/uvx b/test/fallback/completions/uvx new file mode 120000 index 00000000000..ae2e60b1d70 --- /dev/null +++ b/test/fallback/completions/uvx @@ -0,0 +1 @@ +../../../completions/_uvx \ No newline at end of file