add support for custom bash completers and choices#643
add support for custom bash completers and choices#643ericfrederich wants to merge 1 commit intopallets:masterfrom
Conversation
52e9b62 to
d11905b
Compare
|
updated now with passing tests; added some tests for this new feature too |
click/_bashcomplete.py
Outdated
| if last_complete in param.opts: | ||
| if param.completer is not None: | ||
| choices.extend(str(c) for c in param.completer()) | ||
| if param.choices is not None: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I suspect this command is slightly buggy when completing a option with |
d11905b to
e63266d
Compare
|
@untitaker This patch should fix all the issues you mentioned with the previous one. |
e63266d to
21446cd
Compare
|
Could you add a testcase that uses Thanks! On Thu, Sep 01, 2016 at 01:28:14PM -0700, Eric L. Frederich wrote:
|
|
@untitaker as I'm getting more familiar with Click's internals I'm going to close this request and do a better implementation later... hopefully soon! |
|
Okay cool. Feel free to email me if you're unclear about something. |
After writing this I noticed #428 which mentioned #241 but thought I'd submit this pull request anyway.
This one uses
completerandchoicesas keyword arguments using the same terminology as argcompleteDunno how hacky this is, but I got it to work for me. I basically pass some more context (the last parsed argument) to
get_choiceswhich it uses to look up eithercompleterorchoicesattributes on the option.