commit 952a7561d39fcc22be9772d4ef95496f41607270 Author: Zoran Peričić Date: Tue Mar 17 22:41:16 2026 +0100 v0.12.0-1 diff --git a/_tea b/_tea new file mode 100644 index 0000000..a5aaef1 --- /dev/null +++ b/_tea @@ -0,0 +1,11 @@ +#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 new file mode 100644 index 0000000..3697cd4 --- /dev/null +++ b/tea.bash @@ -0,0 +1,14 @@ +# 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 new file mode 100644 index 0000000..afbb06a --- /dev/null +++ b/tea.fish @@ -0,0 +1 @@ +complete -c tea -f -a '(tea --generate-shell-completion)' diff --git a/tea.spec b/tea.spec new file mode 100644 index 0000000..5962b99 --- /dev/null +++ b/tea.spec @@ -0,0 +1,46 @@ +Name: tea +Version: 0.12.0 +Release: 1%{?dist} +Summary: Gitea CLI tool for interacting with Gitea servers. +License: MIT +Group: System Environment/Base +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 + +%description +tea is a command line tool to interact with Gitea servers. +It uses the Gitea API to manage issues, pull requests, releases and more, +similar to how gh works for GitHub. + +%install +%{__rm} -rf %{buildroot} + +install -d -m 755 %{buildroot}%{_bindir} +%ifarch x86_64 +install -m 755 %{SOURCE0} %{buildroot}%{_bindir}/tea +%endif + +%ifarch aarch64 +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 + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{_bindir}/tea +%{_datadir}/bash-completion/completions/tea +%{_datadir}/zsh/site-functions/_tea +%{_datadir}/fish/vendor_completions.d/tea.fish