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

Make completions work with an alias #1035

Merged
merged 7 commits into from
Dec 2, 2021
Merged

Make completions work with an alias #1035

merged 7 commits into from
Dec 2, 2021

Conversation

kurtbuilds
Copy link
Contributor

Right now if you use the README recommended alias, alias j=just, in bash, it stops shell completion from working.

This is a small PR to allow the bash completions script to work with an alias, and adds instructions in the README for how to use it.

@casey
Copy link
Owner

casey commented Nov 28, 2021

Thanks for the PR! The completions are actually generated by clap, the command-line parsing library that just uses. I think this should actually be submitted as a PR to the upstream project.

For now though, the changes need to be added to the BASH_COMPLETION_REPLACEMENTS here. It takes the form of a slice of tuples, with the first element being the part to look for, and the second being the part to replace.

@kurtbuilds
Copy link
Contributor Author

kurtbuilds commented Nov 28, 2021

Thank you for the comments! I fixed this PR and added an upstream PR to clap to fix it for other projects.

Note that just still relies on clap version 2.33.3, and I submitted the PR to the master branch, which has version 3.0.0-beta5, so after that PR merges, this PR still should remain until just updates clap to ^3.

I confirmed that the checked-in completions.bash file does not change when re-running completions with the updated completion function included in this PR.

README.adoc Outdated Show resolved Hide resolved
@casey
Copy link
Owner

casey commented Nov 29, 2021

Nice, one comment, but otherwise looks great.

Co-authored-by: Casey Rodarmor <[email protected]>
@kurtbuilds
Copy link
Contributor Author

@casey Wanted to make sure this doesn't get lost in the ether - anything blocking merging this in?

@casey casey enabled auto-merge (squash) December 1, 2021 23:22
@casey
Copy link
Owner

casey commented Dec 1, 2021

Thanks for pinging this issue! I didn't get a notification when you made the change to this branch, but it looks good to go. I hit the auto-merge button so it should merge when the tests pass.

@casey
Copy link
Owner

casey commented Dec 1, 2021

The tests failed, it looks like because there's a formatting diff.

auto-merge was automatically disabled December 2, 2021 00:48

Head branch was pushed to by a user without write access

@kurtbuilds
Copy link
Contributor Author

kurtbuilds commented Dec 2, 2021

Oops, thanks. I ran tests but not formatting. Fixed. It looks like me pushing that caused the auto-merge to reset.

Thank you!

@casey casey enabled auto-merge (squash) December 2, 2021 03:36
@casey casey merged commit f70b671 into casey:master Dec 2, 2021
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