Improve bash completion with alias extraction and submodule support#2968
Open
tomers wants to merge 4 commits intocasey:masterfrom
Open
Improve bash completion with alias extraction and submodule support#2968tomers wants to merge 4 commits intocasey:masterfrom
tomers wants to merge 4 commits intocasey:masterfrom
Conversation
Enhanced the bash completion script with the following improvements: - Extract both recipes and aliases from 'just --list' output instead of only using 'just --summary', providing more complete completions - Add support for submodule recipe completion when typing 'just <module> <recipe>' - Automatically detect module justfiles in common locations (, /justfile, modules/, modules//justfile) - Parse aliases from both [alias: ...] and [aliases: ...] patterns in list output - Add fallback to --summary if --list fails for better compatibility - Improve recipe name extraction to handle edge cases better These changes make tab completion more comprehensive and useful for projects using just modules and aliases.
Update ~/.just.bash completion function to derive subcommands from just --summary Make recipe completion hierarchical, completing one :: segment at a time Support arbitrary nesting depth so patterns like j tests api test complete step-by-step instead of tests api::test
e92f9c5 to
cdb12ab
Compare
Refactor the completion function to locate and utilize justfiles in project directories, allowing for more accurate recipe and alias completions. This update improves the hierarchical completion by searching for justfiles based on the current working directory and the provided prefix, while maintaining a fallback to the previous summary method for broader compatibility.
Contributor
|
I tried this change out. Really some nice completion going on |
Author
|
@casey can you please have a look? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhanced the bash completion script with the following improvements:
These changes make tab completion more comprehensive and useful for projects using just modules and aliases.