Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a completion function for zsh #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okapia
Copy link

@okapia okapia commented Dec 10, 2021

This adds a file containing an autoloadable completion function for use with zsh so that zsh users can get hints on vmtouch usage with their tab key.

In the process, I noticed that because the -l option implies -t and sets o_touch, you get an error message for the -t/-e combination when combining -l with -e. The -l/-e check was thus dead code. By rearranging it to check -t/-e after -l/-e, error messages are better. I also added a similar line for -L/-e. There could be ways to refactor it so that instead of the error message being repeated you can use %c for each option letter.

For the option descriptions in the usage() function, you've used imperative mood form for all but one option. The exception is -i which starts with the word "ignores". I have changed it for consistency, both in usage() and when copying it for the zsh completion.

I've also added to the Makefile to install the completion.

Also correct error checking for mutually exclusive options.
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.

1 participant