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

Zsh completion doesn't complete flags after positional arguments #392

Closed
AndydeCleyre opened this issue May 15, 2024 · 6 comments
Closed

Comments

@AndydeCleyre
Copy link

6.0.0

Given the file sample.txt:

abcd

Each of the following commands will work as expected:

$ ugrep bc sample.txt --only-matching
$ ugrep bc --only-matching
$ ug bc sample.txt --only-matching
$ ug bc --only-matching

But in none of those cases will the --only-matching flag be tab-completed.

@genivia-inc
Copy link
Member

Unlike fish and bash completions, zsh options are completed when specified before the pattern and file arguments. If you know how to get zsh completions to also work after pattern and/or file arguments then let me know.

@AndydeCleyre
Copy link
Author

I haven't figured it out, but can provide the example of ripgrep's Zsh completion, which seems to achieve the goal.

@genivia-inc
Copy link
Member

Zsh grep completions do a better job and have been around for a long time. Since ugrep is backward compatible to grep, I'll try to work some of the zsh grep completions into ugrep's completions.

@genivia-inc
Copy link
Member

Committed a fix. This update also makes several options repeatable when they are repeatable, such as -e PATTERN, same as zsh grep completions.

@AndydeCleyre
Copy link
Author

Thank you!

genivia-inc added a commit that referenced this issue Jun 3, 2024
fix #234 fix #395 fix #394 fix #392 fix #389  fix #373
@genivia-inc
Copy link
Member

Completions are updated in release 6.1.

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

No branches or pull requests

2 participants