Uh oh!
There was an error while loading. Please reload this page.
add support for custom bash completers and choices - #643
Conversation
ericfrederich
commented
Aug 29, 2016
updated now with passing tests; added some tests for this new feature too |
| 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.
Uh oh!
There was an error while loading. Please reload this page.
untitaker
commented
Aug 29, 2016
I suspect this command is slightly buggy when completing a option with |
d11905b to
e63266dCompareericfrederich
commented
Sep 1, 2016
@untitaker This patch should fix all the issues you mentioned with the previous one. |
e63266d to
21446cdCompareuntitaker
commented
Sep 6, 2016
Could you add a testcase that uses Thanks! On Thu, Sep 01, 2016 at 01:28:14PM -0700, Eric L. Frederich wrote:
|
ericfrederich
commented
Sep 7, 2016
@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! |
untitaker
commented
Sep 7, 2016
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.