Show flag name instead of True/False with Boolean flags#1617
Conversation
|
@davidism, I have one major question regarding this fix: Should we show the flag names only for boolean flags or any? For example, test_global_show_default expects default on the help flag line to be false. For now, I did a workaround to not display the default flag name when it is help. I am not sure if that's a bad thing. |
juped
left a comment
There was a problem hiding this comment.
I recommend splitting the history into maybe two commits (one something like "Display flag name instead of True/False for default in help" and one "Add test [...]"), or maybe just one
|
Unless the test is particularly complex, I usually just roll it into the code commit. Same for multiple code and cleanup commits into a single commit. |
|
Updated the implementation so that it checks that the boolean flag actually has separate flags for @click.option("--cache/--no-cache", "--c/--nc", show_default=True)Now it outputs only Updated the test to check when |
Thank you so much for the feedback! |
Fixes #1538