-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show_choices=False
seems to have no effect
#2356
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
It's somehow strange that there is even a test for this case, but for some reason looks not to be failing Line 198 in fb43272
|
It looks like the Adding mups@docker:~$ demoecho
String to echo: Where as setting mups@docker:~$ demoecho
String to echo (hello, world): The help text is showing the metavar of a Choice object. The The mups@docker:~$ demoecho --help
Usage: demoecho [OPTIONS]
Options:
-s, --string-to-echo CHOICE The string echoed back to stdout.
--help Show this message and exit. But I think the better option in this case would be to return an empty string which would look like this: mups@docker:~$ demoecho --help
Usage: demoecho [OPTIONS]
Options:
-s, --string-to-echo The string echoed back to stdout.
--help Show this message and exit. Which do you prefer? |
Hi @mrmups . I think better would be |
@zmoon Good point. In fact, it should probably just create a set of metavars based on the mups@docker:~$ demoecho --help
Usage: demoecho [OPTIONS]
Options:
-s, --string [TEXT] This value echoed back to stdout.
--help Show this message and exit. and if we added the choice mups@docker:~$ demoecho --help
Usage: demoecho [OPTIONS]
Options:
-s, --string [TEXT|INTEGER] This value echoed back to stdout.
--help Show this message and exit. |
I noticed when using Typer that even if you pass
show_choices=False
, the choices still get shown in the help. It seems that this is related to Click.Example:
I guess it isn't documented what
show_choices
does forOption
(if anything) in the non-prompt case, but I expectedshow_choices=False
to disable showing the choices in the help.Environment:
The text was updated successfully, but these errors were encountered: