Open brooksmtownsend opened 3 weeks ago
Hi @brooksmtownsend ! I'd like to work on this issue, could you assign it to me?
Thanks, @nm723!
Do you have an estimate as to when you would have this work ready for some initial feedback? Note that this is not a hard rule—we just like to get rough estimates up front so we can be helpful with checkins and scheduling.
@lachieh Thanks for assigning it to me. I think it will take about a week, but I'm not totally sure yet. I'll let you know if there are any changes.
Thanks @nm723 ! Please feel free to open a draft PR for initial feedback anytime 😄 Especially if you have questions
Sorry @lachieh , I couldn’t find enough time this week, so it’s looking like I’ll need to finish it next week.
No problems! Thanks for the update! If there's anything you need, be sure to ask!
I tried clap_autocomplete, then I found out it is a simplification of creating completion files, by simply running <command> complete
, which detects the shell and generates the file in the appropriate location.
Therefore, I think it does not provide any hooks for dynamic actions. (Anyway, I found an error and created fix PR on it. )
I found this issue, and I think it's what we want to do. In the issue, there was an announcement that the initial version was released 2 months ago (docs). It looks like we need to enable the unstable-dynamic
feature on clap_complete
to use it, but is it okay to use an unstable feature? @brooksmtownsend
Affected project(s)
Is your feature request related to a problem? Please describe.
I find it pretty frustrating that when using
wash
I can't tab autocomplete to fill in easily searchable values. For example, if I want to undeploy an application namedrust-hello-world
, and I have another app calledfoobar
, I can't do the following to avoid typing in the whole app name (or realistically, copy/pasting it):Same thing with referencing control interface values:
Describe the solution you'd like
The clap_autocomplete crate is a great way to do this since we already use clap. In response to a event for an argument where there is an existing entity in the lattice, we should be able to query for it.
For example, after typing
wash stop host <TAB>
, we should be able to use the clap autocomplete hook to query the lattice for hosts, and return a set of host IDs.Describe alternatives you've considered
There are many different commands this could be used for in
wash
, but to start the ctl + app subcommands will be the most impactful.Additional context
Note that we already have autocompletion for the wash subcommands, I specifically want to add the feature here to autocomplete for arguments about existing resources in a wasmCloud cluster. The old command autocomplete should still work after we do this.