Closed u-shiori closed 3 months ago
Hi, maintainers.
The current sphinx-click does not reflect the value of show_default set in context_settings.
sphinx-click
show_default
context_settings
When implemented using context_settings as shown here,
@click.command(context_settings={"show_default": True}) @click.option('--no-set', default=0) def foobar(): """A sample command.""" pass ctx = click.Context(foobar, info_name='foobar', show_default=True) output = list(ext._format_command(ctx, nested='short')) print("\n".join(output))
I originally want output like: (defaults are shown)
A sample command. .. program:: foobar .. code-block:: shell foobar [OPTIONS] .. rubric:: Options .. option:: --no-set <no_set> :default: ``0``
but currently, it returns results like: (defaults are not shown)
A sample command. .. program:: foobar .. code-block:: shell foobar [OPTIONS] .. rubric:: Options .. option:: --no-set <no_set>
I would like to submit a PR.
Hi, maintainers.
The current
sphinx-click
does not reflect the value ofshow_default
set incontext_settings
.When implemented using
context_settings
as shown here,I originally want output like: (defaults are shown)
but currently, it returns results like: (defaults are not shown)
Note