From 95b685801bed292513b9939ccea37018a06e325b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoran=20Peri=C4=8Di=C4=87?= Date: Sat, 3 Oct 2026 01:48:18 +0200 Subject: [PATCH] tea: update to 0.16.0, generate shell completions at build time The hand-written bash completion split "name:description" on spaces, offering junk candidates. Use tea's own urfave/cli-generated scripts. --- _tea | 11 ----------- tea.bash | 14 -------------- tea.fish | 1 - tea.spec | 14 +++++++------- 4 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 _tea delete mode 100644 tea.bash delete mode 100644 tea.fish diff --git a/_tea b/_tea deleted file mode 100644 index a5aaef1..0000000 --- a/_tea +++ /dev/null @@ -1,11 +0,0 @@ -#compdef tea - -_tea() { - local -a opts - local cur - cur=${words[-1]} - opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}") - compadd -S '' -- "${opts[@]}" -} - -compdef _tea tea diff --git a/tea.bash b/tea.bash deleted file mode 100644 index 3697cd4..0000000 --- a/tea.bash +++ /dev/null @@ -1,14 +0,0 @@ -# bash completion for tea - -_tea_bash_autocomplete() { - if [[ "${COMP_WORDS[0]}" != "source" ]]; then - local cur opts - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - opts=$(${COMP_WORDS[@]:0:$COMP_CWORD} --generate-shell-completion) - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return 0 - fi -} - -complete -o bashdefault -o default -o nospace -F _tea_bash_autocomplete tea diff --git a/tea.fish b/tea.fish deleted file mode 100644 index afbb06a..0000000 --- a/tea.fish +++ /dev/null @@ -1 +0,0 @@ -complete -c tea -f -a '(tea --generate-shell-completion)' diff --git a/tea.spec b/tea.spec index b60951f..3665322 100644 --- a/tea.spec +++ b/tea.spec @@ -1,5 +1,5 @@ Name: tea -Version: 0.14.2 +Version: 0.16.0 Release: 1%{?dist} Summary: Gitea CLI tool for interacting with Gitea servers. License: MIT @@ -8,9 +8,6 @@ URL: https://gitea.com/gitea/tea Source0: https://dl.gitea.com/tea/%{version}/tea-%{version}-linux-amd64 Source1: https://dl.gitea.com/tea/%{version}/tea-%{version}-linux-arm64 -Source10: tea.bash -Source11: _tea -Source12: tea.fish ExclusiveArch: x86_64 aarch64 @@ -31,9 +28,12 @@ install -m 755 %{SOURCE0} %{buildroot}%{_bindir}/tea install -m 755 %{SOURCE1} %{buildroot}%{_bindir}/tea %endif -install -p -D -m 644 %{SOURCE10} %{buildroot}%{_datadir}/bash-completion/completions/tea -install -p -D -m 644 %{SOURCE11} %{buildroot}%{_datadir}/zsh/site-functions/_tea -install -p -D -m 644 %{SOURCE12} %{buildroot}%{_datadir}/fish/vendor_completions.d/tea.fish +install -d -m 755 %{buildroot}%{_datadir}/bash-completion/completions \ + %{buildroot}%{_datadir}/zsh/site-functions \ + %{buildroot}%{_datadir}/fish/vendor_completions.d +%{buildroot}%{_bindir}/tea completion bash > %{buildroot}%{_datadir}/bash-completion/completions/tea +%{buildroot}%{_bindir}/tea completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_tea +%{buildroot}%{_bindir}/tea completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/tea.fish %clean %{__rm} -rf %{buildroot}