Join GitHub today
Dynamic bash autocompletion #755
This PR enables arguments to supply an auto completion callback that dynamically generates completion options. This allows Click to complete arguments that are dynamic in nature like git branch names, database variables, and any other number of things. Much thanks to @bb4242 for spearheading this change. Brett, feel free to take a look! Feedback is welcome!
changed the title from
Feature/bash autocompletion 6.6
Dynamic bash autocompletion
Mar 27, 2017
This was referenced
Mar 27, 2017
referenced this pull request
Mar 28, 2017
Lgtm, will merge tomorrow…
On April 15, 2017 9:25:05 PM GMT+02:00, Nicholas Wiles ***@***.***> wrote: stopthatcow commented on this pull request. > @@ -97,6 +96,23 @@ def is_incomplete_argument(current_params, cmd_param): return True return False +def get_user_autocompletions(ctx, args, incomplete, cmd_param): + """ + :param ctx: context associated with the parsed command + :param args: full list of args + :param incomplete: the incomplete text to autocomplete + :param cmd_param: command definition + :return: all the possible user-specified completions for the param + """ + choices =  + if isinstance(cmd_param.type, Choice): + choices = cmd_param.type.choices Sounds good. -- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: #755 (comment)
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.