blackd: show default values for options (#3712)
* blackd: show default values for options Reference: https://click.palletsprojects.com/en/8.1.x/api/#click.Option * Fix spacing in CHANGES.md
This commit is contained in:
parent
a4032dce64
commit
a538ab7663
@ -44,6 +44,9 @@
|
|||||||
|
|
||||||
<!-- Changes to blackd -->
|
<!-- Changes to blackd -->
|
||||||
|
|
||||||
|
- The `blackd` argument parser now shows the default values for options in their help
|
||||||
|
text (#3712)
|
||||||
|
|
||||||
### Integrations
|
### Integrations
|
||||||
|
|
||||||
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
||||||
|
@ -59,9 +59,15 @@ class InvalidVariantHeader(Exception):
|
|||||||
|
|
||||||
@click.command(context_settings={"help_option_names": ["-h", "--help"]})
|
@click.command(context_settings={"help_option_names": ["-h", "--help"]})
|
||||||
@click.option(
|
@click.option(
|
||||||
"--bind-host", type=str, help="Address to bind the server to.", default="localhost"
|
"--bind-host",
|
||||||
|
type=str,
|
||||||
|
help="Address to bind the server to.",
|
||||||
|
default="localhost",
|
||||||
|
show_default=True,
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
"--bind-port", type=int, help="Port to listen on", default=45484, show_default=True
|
||||||
)
|
)
|
||||||
@click.option("--bind-port", type=int, help="Port to listen on", default=45484)
|
|
||||||
@click.version_option(version=black.__version__)
|
@click.version_option(version=black.__version__)
|
||||||
def main(bind_host: str, bind_port: int) -> None:
|
def main(bind_host: str, bind_port: int) -> None:
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
Loading…
Reference in New Issue
Block a user