-
Notifications
You must be signed in to change notification settings - Fork 0
Support automatic subcommands for completion #68
Comments
This would be an easy addition, although it'd probably get implemented as an The one thing that gives me pause, is that I've seen this done in a few different ways by different applications, such as Is the |
I don't know if one is more popular/"standard" than another. I thought I had other examples up my sleeve, but the only one I can think of now is |
In all honesty it'd be possible to give options for both, which is how I think I'll tackle this.
|
Is this possible anymore? The clap_generate package depends on clap. Won't this be a circular package dependency? working in this branch: |
@CreepySkeleton Would love your input here. |
That's possible. We can make Pros:
Cons: |
@CreepySkeleton You mean |
There must have been a reason Kevin wanted to make it a separate crate. On Tue, Mar 3, 2020, 16:47 Guillaume P. notifications@github.com wrote:
|
@TeXitoi right 😨 |
I don't see any reason, honestly. Not any I would call a good one. |
The advantage is that you will not compile it if you don't use it. The other solution is features, and I personally prefer to keep features to the bare minimum as they complexify the code considerably. But, having this implementation hole is quite dirty. I think the clean way would be:
The second way seems easier now. But that's just my humble opinion, I didn't even seen the code. |
I made as much of introspection API public. The remaning stuff are |
That's gonna be one module level I've seen the code, I've been trying to implement an introspection API of sorts (you just read my mind 😃, ha!), and I feel like I'm failing.
You did? Mind elaborate? |
I hate to be rude, but that's actually not true at all. Just grep for |
@TeXitoi They seem to be implementing explicit support for features in docs.rs, see dtolnay/syn#734 . We might as well do that too. Looks neat unless you have lots of cfg'ed items (we don't): https://docs.rs/tokio/0.2.13/tokio/index.html#modules |
@pksunkara @kbknapp So can we finally decide whether we want this or not? More specifically, are we open to inclusion |
I will take care of this. I have a few ideas on how to fix this. |
btw another way of solving this is instead of having a setting for this, to provide types that implement |
Saturday Jan 07, 2017 at 23:48 GMT
Originally opened as clap-rs/clap#810
It seems to be something of a pattern for apps to support completion via the following:
It'd be nice if there were a helper on
App
so that we could call.add_completion_subcommands()
and have this wired up automatically.The text was updated successfully, but these errors were encountered: