Skip to content

Implement file globbing support#186

Draft
simaoafonso-pwt wants to merge 4 commits intoiterative:mainfrom
simaoafonso-pwt:issue/69-globs
Draft

Implement file globbing support#186
simaoafonso-pwt wants to merge 4 commits intoiterative:mainfrom
simaoafonso-pwt:issue/69-globs

Conversation

@simaoafonso-pwt
Copy link
Copy Markdown
Contributor

This is tested locally in tcsh and bash, zsh is untested.

There should not be any regressions, the test suite passes. We can bikeshed the name.

I did not add support for globbing folders, this doesn't seem to be supported in zsh. I also did not implement the sub-folder support (that is, showing all folders on the file glob completion, so you can descend the hierarchy) since this is only supported in bash. I accept this feature might be required, and are willing to implement it.


This is based on https://github.com/iterative/shtab/blob/main/examples/customcomplete.py#L11-L22.

For zsh, https://zsh-manual.netlify.app/completion-system mentions there's no support for globbing folders.

Fix #124 #69

@codecov
Copy link
Copy Markdown

codecov bot commented May 5, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
shtab/__init__.py 66.66% 9 Missing ⚠️

📢 Thoughts on this report? Let us know!

Move existing code to a common function.
This is tested locally in tcsh and bash, zsh is untested.

There should not be any regressions, the test suite passes.
@simaoafonso-pwt
Copy link
Copy Markdown
Contributor Author

Rebased to the latest version.

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.

[feature] Can it provide a function to generate code like <https://github.com/iterative/shtab/blob/main/examples/customcomplete.py#L11-L22>

1 participant