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

Feature request for completing external subcommand #5678

Closed
2 tasks done
shannmu opened this issue Aug 16, 2024 · 0 comments
Closed
2 tasks done

Feature request for completing external subcommand #5678

shannmu opened this issue Aug 16, 2024 · 0 comments
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@shannmu
Copy link
Contributor

shannmu commented Aug 16, 2024

Please complete the following tasks

Clap Version

master

Describe your use case

Cargo can invoke external commands. If there is a cargo-foo binary in the PATH environment variable, we can run it like a Cargo subcommand by using cargo foo.
What i want is to complete cargo fo[TAB] to cargo foo

Describe the solution you'd like

  • Add a struct like SubcommadCompleter
  • impl CustomCompleter for SubcommadCompleter
  • invoke the complete callback when there is no positional argument on Command, or the pos_index is 1.

Additional Context

See #3166 to get more context

@shannmu shannmu added the C-enhancement Category: Raise on the bar on expectations label Aug 16, 2024
@shannmu shannmu closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

1 participant