From 6aa8078cc1f54a5c6e6197d7e0273e36ed55060e Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Fri, 1 Mar 2019 15:39:51 -0700 Subject: zsh completion Weekend hack by someone who doesn't grok zsh completion but who finds it deeply offensive that most completion files have an unmaintainable duplication of options and arguments. The idea behind this one is to discover the command line using --help, with a few hardcoded helpers for discovering containers, images, pods, and figuring out which args take files/dirs as args. Working remarkably well. I am using this in my daily routine and wondering how I ever managed without it. It's not perfect -- a future version can perhaps show only stopped containers for podman rm, only running ones for podman stop -- but ROI seems low on that given my limited zsh completion skills. Sadly, I can't figure out how to write a regression test suite for this. It would be lovely to have a list if partial command lines and expected completions, because the history of this change is that (seemingly) minor tweaks in one place cause breakage in another. Does anyone know of such a framework? Still... working well enough to ship, IMO. Signed-off-by: Ed Santiago --- contrib/spec/podman.spec.in | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/spec') diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in index 703b942b6..3324ee8f9 100644 --- a/contrib/spec/podman.spec.in +++ b/contrib/spec/podman.spec.in @@ -472,6 +472,7 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %{_mandir}/man1/*.1* %{_mandir}/man5/*.5* %{_datadir}/bash-completion/completions/* +%{_datadir}/zsh/site-functions/* %{_libexecdir}/%{name}/conmon %config(noreplace) %{_sysconfdir}/cni/net.d/87-%{name}-bridge.conflist %{_datadir}/containers/%{repo}.conf -- cgit v1.2.3-54-g00ecf