pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

zsh completion for `tea +pkg`

Open mxcl opened this issue 2 years ago • 3 comments

The results can be obtained with:

cd $(tea --prefix)/tea.xyz/var/pantry/projects
find * -name package.yml -type f -exec dirname {} \;

mxcl avatar Oct 29 '22 21:10 mxcl

My brain thinks this is the same as:

find $(tea --prefix)/tea.xyz/var/pantry/projects -name package.yml -type f -exec dirname {} \; | sed -e "s|$(tea --prefix)/tea.xyz/var/pantry/projects/||"

which replaces the cd with a second invocation of tea and requires sed. Probably not better, but cd can add weirdness. My shell also doesn't know surname (but I'm not using zsh).

jhheider avatar Nov 12 '22 00:11 jhheider

Provided it operates in a subshell the cd is safe. I prefer doing less and relying on sed with its platform specific quirks seems riskier.

mxcl avatar Nov 13 '22 18:11 mxcl

Yeah, agreed. The final form might be profitably added to the client as tea --completions.

jhheider avatar Nov 13 '22 23:11 jhheider

This should be added to --magic

mxcl avatar Jan 18 '23 15:01 mxcl

Closing in lieu of #591

mxcl avatar Jun 07 '23 19:06 mxcl