tab completion during interactive prompts
It would be nice if click would support tab completion when prompting for files and paths.
The shell command read -e offers a prompt with tab completion. However, the -e flag is a bashism, so we can only use this when bash is installed. I think only offering tab completion when bash is installed is a reasonable tradeoff to make, as any custom tab-completion would require much more code.
Personally, I'm a zsh user, but given a bash solution I'd figure something.
On the other hand, tab completion shouldn't be too difficult in pure python.
The solution i proposed only requires it to be installed, not to be used.
Good point. However, read -e is using readline, which is GPL, which I'm not sure whether we can use in click.
Independent of bash vs python, displaying matches feels more complex than gathering the matches.
Would bash's read -e solve that for us?
It does the whole prompt-thing for us and saves the result in a shell variable. I think i'll try to write a first implementation later this evening. @mitsuhiko Thoughts?
The whole completion support needs rewriting or cleaning up. It absolutely makes no sense currently. It's wrong and mostly works by chance :)
I don't think the command completion for bash is technically related to this.
Um.. anything on this? I see that there's a PR on this at #428 ... but it's sorta old.
Do we have tab completion for choice option prompts? Does this fit this issues scope after adjusting title and description or shall I open a new issue?
The completion system has been totally rewritten in #1622. The prompt system can get completions for a parameter by calling param.shell_complete(ctx, incomplete). #181 explored using readline, but that's not guaranteed to be built with Python, and there's an issue around license. It also points out that there are other nice solutions like prompt-toolkit. I'd like to avoid adding optional dependencies, so the first thing that needs to be done is to design a way for prompt to be customized more, so extensions could provide implementations.