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.
This commit is contained in:
1 parent
99bd16d844
commit
95b685801b
4 files changed
+7
-33
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user