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 helper scripts for testing the shell completions #3072

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

Conversation

bash
Copy link
Contributor

@bash bash commented Aug 18, 2024

While working on #2896 I needed a way to test the shell completions.

So I put together a script for each shell (PowerShell is notably missing) that spawns the shell
with the right PATH / completions setup. It might be useful to other people too :)

Copy link
Collaborator

@keith-hall keith-hall left a comment

Choose a reason for hiding this comment

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

Hi, thanks for this. I'm keen to improve the developer experience for testing changes made to completions files, to help encourage us all to do a better job of keeping them up to date. (re: #3170)
Now that we have #3126, do you think any changes need to be made to these test helper scripts?
I had the idea that it might be nice to create a subfolder and put them all together there to reduce clutter, but maybe it's not necessary as they all have the same name just different extension 🤔

@epage
Copy link
Contributor

epage commented Jan 28, 2025

btw https://docs.rs/completest-pty/latest/completest_pty/ can be used to write tests runnable in cargo test for completions. Its what clap_complete is using (to a limited degree; its slow)

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.

3 participants