Uh oh!
There was an error while loading. Please reload this page.
Support for autocompletion of arguments - #428
Conversation
rossant
commented
Oct 16, 2015
@cbandera did you get any feedback? I would love to see a feature like this merged into the library. |
cbandera
commented
Oct 16, 2015
bb4242
commented
Dec 11, 2015
Just wanted to add my support for this feature - it's really useful! :) @mitsuhiko, do you have any thoughts on this pull request? |
The callback receives the following data: - The current click context. This allows the callback to access any parameters that are already present on the command line. - The current word being completed. This may be an empty string. - The bash COMP_CWORDS and COMP_CWORD variables, in case the callback wants to do raw parsing of this data.
con-f-use
commented
Dec 16, 2015
+1 from me. Nitpicking a bit here but |
bb4242
commented
Dec 16, 2015
@cbandera: I've been thinking about dynamically generating the suggestions. What do you think about allowing |
cbandera
commented
Dec 17, 2015
@bb4242 I have tested your additions and I think they are a good extension. I had thought about callback functions before too. But before I merge your additions, could you please add Documentation (in the docs directory) and an example file (in examples) to the repo? @con-f-use Good point. I like |
bb4242
commented
Dec 17, 2015
Feature/parameter autocompletion
bb4242
commented
Dec 21, 2015
I've noticed two other small problems while using this feature, which are illustrated in a modified version of the
I think this has to do with the way the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
gtristan
commented
May 6, 2017
Completion of arguments is not working for me, but I'm not sure if I'm doing it right. My CLI frontend (can be seen here ) has sub commands and lots of options, options and subcommands all complete well. What I would expect:
Is this intended to work with the above patches being merged in master ? |
JosiahDub
commented
May 14, 2018
This PR no longer appears relevant. |
wreed4
commented
May 15, 2018
Is this released then? I'm using 6.7 and still don't see this working. |
davidism
commented
May 17, 2018
I'm not sure what's going on with 6, but autocompletion for Bash and ZSH will definitely be in 7 when that's released. |
Hi,
this is an enhancement to support autocompletion of arguments, as discussed in issue #241.
With this version of click, it is possible to add optional autocomplete suggestions to an argument. This is done by passing a list of str's via the
autocompletionparameter in the argument decorator:I have added example code and altered the documentation to include the new feature.
Notes:
Looking forward to your feedback