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

Show completions for args with declared choices #1532

Closed
rcorre opened this issue May 28, 2016 · 5 comments
Closed

Show completions for args with declared choices #1532

rcorre opened this issue May 28, 2016 · 5 comments
Labels
component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@rcorre
Copy link

rcorre commented May 28, 2016

Now that cmdutils.argument is being used (c33f0c3), there's some potential for expanding completions for commands.

After inputting --someflag or --someflag= in the command bar, we could show completions if that flag has choices.

  1. Is there already someone working on this?
  2. Would it be a bad idea to do this before the proposed completion revamp in Completion model/view revamping #74?

I threw together a really rough proof-of-concept in 6b2fb66

file

@The-Compiler The-Compiler added component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important. labels May 30, 2016
@The-Compiler
Copy link
Member

Sorry for the delay - I think your proposed code is simple enough to include it before #74, and yay for more discoverability!

I think :bind is the only command which has a flag with an argument though, so it'd be nice if this would also work for positional arguments with choices (e.g. when doing :navigate) if it doesn't yet.

@rcorre
Copy link
Author

rcorre commented May 30, 2016

I think :bind is the only command which has a flag with an argument though, so it'd be nice if this would also work for positional arguments with choices

Yeah, that's part of the plan. I was thinking there'd be more flags with choices, but I guess not. I'd just been working with bind a lot recently so that was on my mind.
Completions for the flags themselves would be nice too. I'll poke around and see how much complexity that will add.

@The-Compiler
Copy link
Member

Completions for the flags themselves would be nice too. I'll poke around and see how much complexity that will add.

Yep, I already had that in mind in #32 some while ago 😆

I think that'll be a lot harder, because at that point you need composable completions (since for every command, you can have either the completion for the argument, or flags), which basically is the goal of #74.

FWIW I'd also prefer minimal pull requests, makes things easier to review - so if you have something which seems ready and finished enough, feel free to open a PR and then another one when you improve things!

Also, would you be interested in working on that completion revamping (#74)? I don't really have a master plan in mind for that one, and it's unlikely I'll work on anything completion related in the near future - but at the same time I think it's a very important step towards getting more completions. If you think that'd be something you'd like to work on, would you mind joining the IRC channel to talk about the details?

@rcorre
Copy link
Author

rcorre commented Jun 1, 2016

Sounds good to me, I'm willing to try revamping completions. I'll jump on IRC, and we can talk about it some time.

@The-Compiler The-Compiler mentioned this issue Jun 4, 2016
26 tasks
@The-Compiler
Copy link
Member

I added this to #32 to keep all completion ideas in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: completion Issues related to the commandline completion or history. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

2 participants