click-repl icon indicating copy to clipboard operation
click-repl copied to clipboard

Ability to hook custom tab-completions for options, arguments

Open untitaker opened this issue 9 years ago • 3 comments

E.g. show a datepicker, useful for todoman.

untitaker avatar Jul 22 '15 14:07 untitaker

This is amazing work (very useful to me, at least), and would like to see this first issue closed 😄

rcarmo avatar May 15 '17 20:05 rcarmo

Can u provide any example for this? like sample use case, and sample output?

GhostOps77 avatar Mar 24 '23 14:03 GhostOps77

EDIT: As it seems, this feature exists, but there is a bug. I am submitting a bug report

Let me chime in. Say I want to edit a task, and have something like this

todo --edit <task_id>

In the code for --edit I can have something like this

@click.option(
    "-e",
    "--edit",
    type=click.Choice(todo.list_task_id_and_name())
)

Now for --edit when we try to tab to autocomplete it should display the list of task ID and title

tmahmood avatar Jul 21 '23 12:07 tmahmood