-
Notifications
You must be signed in to change notification settings - Fork 0
Support automatic subcommands for completion #68
Comments
Comment by kbknapp 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 |
Comment by colemickens 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 |
Comment by kbknapp In all honesty it'd be possible to give options for both, which is how I think I'll tackle this.
|
Comment by rharriso Is this possible anymore? The clap_generate package depends on clap. Won't this be a circular package dependency? working in this branch: |
Comment by pksunkara @CreepySkeleton Would love your input here. |
Comment by CreepySkeleton That's possible. We can make Pros:
Cons: |
Comment by TeXitoi @CreepySkeleton You mean |
Comment by pksunkara There must have been a reason Kevin wanted to make it a separate crate. On Tue, Mar 3, 2020, 16:47 Guillaume P. [email protected] wrote:
|
Comment by CreepySkeleton @TeXitoi right 😨 |
Comment by CreepySkeleton I don't see any reason, honestly. Not any I would call a good one. |
Comment by TeXitoi 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. |
Comment by pksunkara I made as much of introspection API public. The remaning stuff are |
Comment by CreepySkeleton
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? |
Comment by CreepySkeleton
I hate to be rude, but that's actually not true at all. Just grep for |
Comment by CreepySkeleton @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 |
Comment by CreepySkeleton @pksunkara @kbknapp So can we finally decide whether we want this or not? More specifically, are we open to inclusion |
Comment by pksunkara I will take care of this. I have a few ideas on how to fix this. |
Comment by epage btw another way of solving this is instead of having a setting for this, to provide types that implement |
Issue by colemickens
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: