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

fix(clap_complete): Use bin name instead of package name for bash completions in subcommands #5256

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

Serock3
Copy link
Contributor

@Serock3 Serock3 commented Dec 13, 2023

Fixes #5255

@Serock3 Serock3 changed the title Use bin name instead of package name for bash completions in subcommands fix(clap_complete): Use bin name instead of package name for bash completions in subcommands Dec 14, 2023
@Serock3 Serock3 force-pushed the master branch 3 times, most recently from c4a3d3e to 6d829fc Compare December 14, 2023 08:23
@Serock3
Copy link
Contributor Author

Serock3 commented Dec 14, 2023

Excuse me for triggering the CI pipeline so many times. I had to force push multiple times to make my commit message pass the lint.

@Xanewok
Copy link

Xanewok commented Jan 13, 2024

I've applied the patch and can verify it works for clap_complete 4.4.6 (latest); previously CMD SUBCMD <TAB> would return top-level completions but after the patch it now correctly returns the completion relevant to the subcommand.

@epage is there anything else we can do to merge it? 🙏

@epage
Copy link
Member

epage commented Jan 15, 2024

Sorry for the delay; just now catching up after a Rust blog post, an RFC update, and the holidays

@Serock3 Serock3 force-pushed the master branch 3 times, most recently from 02212b2 to 42e1403 Compare January 16, 2024 11:52
Bash completions for subcommands used package
name, which broke completions when the `bin_name`
was different.

Update the `custom_bin_name` test to reflect the
correct behavior.
@epage
Copy link
Member

epage commented Jan 19, 2024

Thanks!

@epage epage merged commit e1c3575 into clap-rs:master Jan 19, 2024
22 checks passed
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.

clap_complete: subcommands are broken in bash if the binary name is not the same as the package name
3 participants