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

feat(complete): support command alias completions #5412

Closed
wants to merge 1 commit into from

Conversation

nasso
Copy link

@nasso nasso commented Mar 21, 2024

Fixes #4265

first time contributor here! this is probably very naive!

this might be a good temporary "hack" while we wait for #3951 and #3166. if that's a problem maybe a feature flag can be introduced, because tools with a lot of very common aliases (like jj) barely get any completion support right now

@@ -49,6 +49,10 @@ pub fn subcommands(p: &Command) -> Vec<(String, String)> {
);

subcmds.push((sc.get_name().to_string(), sc_bin_name.to_string()));

for a in sc.get_all_aliases() {
Copy link
Member

Choose a reason for hiding this comment

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

As we are generally only doing visible aliases, can you switch this to get_visible_aliases?

Copy link
Author

Choose a reason for hiding this comment

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

sure! on it!

i wasn't sure here because my thinking was that if someone was using an alias, visible or not, they should be getting auto completion still. would using get_visible_aliases break this behaviour? is it intended? (this is a discussion that can be moved to the issue(s) if necessary

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.

Subcommand aliases not included in completion scripts
2 participants