From 03107e6d8b7660ae1a05bf3c91374681bfdb096c Mon Sep 17 00:00:00 2001 From: Israel Date: Mon, 4 Sep 2023 04:27:46 -0300 Subject: [PATCH] `patronictl --help` was showing `ctl` function's docstring (#2845) `patronictl` is implemented using `click` module, and that module uses the functions' docstrings for creating a helper text. As a consequence the docstring for `ctl` function was being shown to the user, which doesn't make sense. This PR fixes that issue by adding a user-friendly description to be shown on `patronictl --help`. We use a `\f` to tell `click` when to stop capturing text to show in the helper. Note that `patronictl` commands are implemented using `@ctl.command` decorator, and we always provide them with `help` argument. That said, none of the subcommands are affected by the aforementioned issue, only the entry point of the CLI. References: PAT-201. --- patroni/ctl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patroni/ctl.py b/patroni/ctl.py index b1d63d2b..c8a396c9 100644 --- a/patroni/ctl.py +++ b/patroni/ctl.py @@ -264,7 +264,9 @@ role_choice = click.Choice(['leader', 'primary', 'standby-leader', 'replica', 's @click.option('-k', '--insecure', is_flag=True, help='Allow connections to SSL sites without certs') @click.pass_context def ctl(ctx: click.Context, config_file: str, dcs_url: Optional[str], insecure: bool) -> None: - """Entry point of ``patronictl`` utility. + """Command-line interface for interacting with Patroni. + \f + Entry point of ``patronictl`` utility. Load the configuration file.