Skip to content

Add basic zsh completion (issue #32)#86

Closed
VorpalBlade wants to merge 7 commits intotavianator:mainfrom
VorpalBlade:feature/zsh-completion
Closed

Add basic zsh completion (issue #32)#86
VorpalBlade wants to merge 7 commits intotavianator:mainfrom
VorpalBlade:feature/zsh-completion

Conversation

@VorpalBlade
Copy link
Copy Markdown
Contributor

This PR adds basic zsh completion. There are a couple of TODO comments I would like your feedback on in the file as well.

Note that I have only tested the basics using bfs 2.5 on Arch Linux (bfs installed using AUR and the completion file installed manually). If anything related to command line handling has changed since that release it will need to be incorporated here.

I have not at all tested the changes to the Makefile at all but they look straight forward.

@VorpalBlade
Copy link
Copy Markdown
Contributor Author

I'm also not sure how -exclude works from the man page. It is possible that the completion that it needs a single argument is not correct.

@tavianator
Copy link
Copy Markdown
Owner

Thanks for this! :)

I'm also not sure how -exclude works from the man page. It is possible that the completion that it needs a single argument is not correct.

-exclude is an operator, like -not, that applies to the expression after it. So

$ bfs -exclude -name .git
$ bfs -exclude \( -name .git -o -name .svn \)

etc.

Copy link
Copy Markdown
Owner

@tavianator tavianator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! I haven't reviewed it in detail yet, but so far all I've noticed is you should update make uninstall to match make install.

@VorpalBlade
Copy link
Copy Markdown
Contributor Author

Done. Though I suggest people use a package manager rather than relying on make uninstall.

@tavianator
Copy link
Copy Markdown
Owner

Done. Though I suggest people use a package manager rather than relying on make uninstall.

Oh for sure! make install is mostly for the benefit of packagers themselves. make uninstall is for my benefit when I'm testing make install :)

(Btw your last patch has a whitespace error, the recipe needs to use a leading tab.)

Anyway I just tried this and it doesn't seem like zsh is using the completion. All I get are files. -<TAB> doesn't show anything. Any idea why?

Comment thread completions/bfs.zsh Outdated
Comment thread completions/bfs.zsh Outdated
@VorpalBlade
Copy link
Copy Markdown
Contributor Author

(Btw your last patch has a whitespace error, the recipe needs to use a leading tab.)

Huh, vscode seems to be doing stupid things in Makefiles.

@tavianator
Copy link
Copy Markdown
Owner

I merged this manually as 7f37e41

@tavianator tavianator closed this Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants