Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a public interface to make your own completion code #644

Closed
kdar opened this issue Sep 1, 2016 · 3 comments
Closed

Support a public interface to make your own completion code #644

kdar opened this issue Sep 1, 2016 · 3 comments
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-hard Call for participation: Experience needed to fix: Hard / a lot

Comments

@kdar
Copy link

kdar commented Sep 1, 2016

My use case here is I'm making a debugger for an emulator, and I use clap as my command handler and linefeed as my readliner. Linefeed has a way to do tab completion in it, so it would be nice if I could get at all the subcommand/options/whatever from clap.

@kbknapp
Copy link
Member

kbknapp commented Sep 5, 2016

I'm not against this, it just may be a while before I can get to something like this. So I'll keep it in the issue tracker for implementation, but need to knock out some other items first.

In the meantime, if you look at src/completions.rs there's not inherently private about how it's done, but exposing those methods at this time would be a messy API. Namely the get_*_for_path() methods are how it's finding options, subcommands, etc. So one could almost copy/paste that into user code and get same affect until I'm able to get a good API for this.

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations P4: nice to have E-hard Call for participation: Experience needed to fix: Hard / a lot A-completion Area: completion generator labels Sep 5, 2016
@kbknapp
Copy link
Member

kbknapp commented Oct 10, 2016

@kdar see also #568 as I plan on working on this in the near term

@kbknapp
Copy link
Member

kbknapp commented Jan 24, 2017

I'm closing this as it's covered by #568

@kbknapp kbknapp closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations E-hard Call for participation: Experience needed to fix: Hard / a lot
Projects
None yet
Development

No branches or pull requests

2 participants