summaryrefslogtreecommitdiff
path: root/examples/completion/completion.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/completion/completion.py')
-rw-r--r--examples/completion/completion.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/completion/completion.py b/examples/completion/completion.py
index abd09c0..6c45a1f 100644
--- a/examples/completion/completion.py
+++ b/examples/completion/completion.py
@@ -38,10 +38,13 @@ def list_users(ctx, param, incomplete):
# of CompletionItem. You can match on whatever you want, including
# the help.
items = [("bob", "butcher"), ("alice", "baker"), ("jerry", "candlestick maker")]
+ out = []
for value, help in items:
if incomplete in value or incomplete in help:
- yield CompletionItem(value, help=help)
+ out.append(CompletionItem(value, help=help))
+
+ return out
@group.command(help="Choose a user")