Open chrisjsewell opened 5 years ago
To summarize what exists for now:
By chance, the Choice class has a complete method that provided the completion against the choice.
What is counter intuitive in the code of click-completion is that we call choice the result of the method complete. That explains why you confounded with the Choice class.
In my mind, the more sensible is to first call get_user_autocompletions (instezd of rewriting part of it in click-completion) , then add the results of the complete method of the type.
Also, I find getattr(optctx, "autocompletion", None) is not None shorter and more readable than hasattr(optctx, 'autocompletion') and optctx.autocompletion is not None.
I did not follow what was done in the other PR and in click. Is this still relevant?
As explained here in the Click documentation, and implemented here: https://github.com/pallets/click/blob/93b1699cde5fbafe8a237f8f0d21c8f687b78f2f/click/_bashcomplete.py#L185, click
Parameter
s have anautocompletion
argument that is currently not supported inclick-completion
. This small addition rectifies that :)