Closed sigoden closed 2 months ago
The given use case for this proposal is focused on "let me provide dynamic completions by teaching clap how to call back into myself to provide those completions". This in effect is an alternative to #1232 which the issue acknowledges.
I prefer issues to be organized around problems, rather than solutions. This ensures we have a holistic conversation, rather than spreading the conversation out across multiple issues, making ti hard to follow.
I feel this would be encouraging people to extend their CLIs in ways that don't make sense from a CLI perspective but just as a workaround for not having the proposed solution in #1232.
This proposal also reuses something targeted at integrating in with shell logic but not for shell logic.
This is also a breaking change since ValueHint
is Copy
. This isn't a reason to say "no" to something on its own but that it raises the bar, making this not viable for a short term solution to a problem.
For these reasons, I'm closing this out. If you have a reason we should reconsider, let us know!
Please complete the following tasks
Clap Version
master
Describe your use case
Add dynamic completion for
clap::Arg
Describe the solution you'd like
Add
ValueHint::Execute(String)
to generating possible completion candidates by exectuting the command.Describe the solution you'd like
Add
ValueHint::Execute(String)
to generate possible completion candidates by executing the command.Each line of the command output is a possible completion candidate.
Environment variabes
$COMP_LINE
and$COMP_POINT
should passed when executing the command.Alternatives, if applicable
No response
Additional Context
Similar issues:
2396
5424
Solved issues:
1232