Allow showing default values globally.
See original GitHub issueFeature request, as in #646, we already had a discussion how to easily show default values for options. As context_settings
is already used to configure global settings anyway, the idea would be to allow the following:
@click.command(
help='Command helptext',
context_settings=dict(show_default=True))
@click.option("--test", default="foobar", help="Option helptext")
def cli(test):
pass
Which should enable show_default
for all options and give the following help text:
$ cli --help
Usage: cli [OPTIONS]
Command helptext
Options:
--test TEXT Option helptext. Default: 'foobar'
--help Show this message and exit.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Use global variables as default values - python - Stack Overflow
Here is a solution with a decorator: from functools import wraps from inspect import getcallargs def defaults_from_globals(f): @wraps(f) def ...
Read more >Set default values for fields or controls - Microsoft Support
This article explains how to set a default value for a table field or for a control on a form in an Access...
Read more >Global Picklists - Allow Unique Default Value for Each Field
Global Picklists are great for standardizing picklist options across objects, but don't work if you need to control different default values in individual ......
Read more >Create default values for your personalization tokens
Enter a default value, which will appear for any visitors who don't have a value for the property you've selected. If you've set...
Read more >Global - set default values during runtime - NI Community
Hello, Is there a way to reinitialize a global variable to default values during runtime? I know how to do it by passing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Temporary workaround:
we have a lot of cli commands and a huge more params for them and going to show default, so we very appreciate for releasing this feature. anyway a year has passed since release 7.0, do you have any plans for releasing 7.1? Thanks.