Skip to content

Problems with dynamic completion #5677

Answered by epage
windsource asked this question in Q&A
Discussion options

You must be logged in to vote

This is a requirement of clap as clap::Command and clap::Arg do not have lifetimes. Adding them would be a breaking change and would have to wait for 5.0, if we decide to do it.

Note that we've recently shifted focus to clap_complete::CompleteEnv which should run before the rest of your application initialization which precludes reusing initialization.

For Cargo, we're running the bare amount of initialization each custom completer needs inside of itself.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@windsource
Comment options

@epage
Comment options

@windsource
Comment options

@epage
Comment options

@windsource
Comment options

Answer selected by windsource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants